JNTUK- A.Y 2022-23 PROGRAMMING FOR PROBLEM SOLVING USING C LAB

 

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

JNTUK-A.Y. 2022-23




PROGRAMMING FOR PROBLEM SOLVING USING C LAB

Course Objectives:

1) Apply the principles of C language in problem solving.
2) To design flowcharts, algorithms and knowing how to debug programs.
3) To design & develop of C programs using arrays, strings pointers &functions.
4) To review the file operations, preprocess or commands
 
Exercise 1:
         1. Write a C program to print a block F using hash (#), where the F 
              has a height of six characters and width of five and four characters.   Program
         2. Write a C program to compute the perimeter and area of a rectangle
              with a height of 7 inches and width of 5inches.     
Program
         3. Write a C program to display multiple variables.  
 Program

Exercise 2:
         1. Write a C program to calculate the distance between the two points.     Program
         2. Write a C program that accepts 4 integers p, q, r, s from the user where
              r and s are positive and p is even. If q is greater than r and s is greater       Program
              than p and if the sum of r and s is greater than the sum of p and q print
              "Correct values", otherwise print "Wrong values".


Exercise 3:
          1. Write a C program to convert a string to along integer.              Program
          2. Write a program in C which is a Menu-Driven Program to compute
               the area of the various geometrical shape.                                    Program

          3. Write a C program to calculate the factorial of a given number.          Program


Exercise 4:
          1. Write a program in C to display the n terms of even natural number and their sum.     Program
          2. Write a program in C to display the n terms of harmonic series
               and their sum. 1 + 1/2 + 1/3 + 1/4 + 1/5 ... 1/n terms.   
Program
          3. Write a C program to check whether a given number is an Armstrong number or not.

Exercise 5:
         1. Write a program in C to print all unique elements in an array.  Program
         2. Write a program in C to separate odd and even integers in separate arrays.   Program
         3. Write a program in C to sort elements of array in ascending order.   
Program

Exercise 6:
         1. Write a program in C for multiplication of two square Matrices.  Program
         2. Write a program in C to find transpose of a given matrix.  Program

Exercise 7:
        1. Write a program in C to search an element in a row wise and   
           column wise sorted matrix.   
Program
        2. Write a program in C to print individual characters of string in reverse order.  
Program

Exercise 8:
      1. Write a program in C to compare two strings without using string
          library functions.     
Program
      2. Write a program in C to copy one string to another string.   
Program

Exercise 9:
       1. Write a C Program to Store Information Using Structures with
           Dynamically Memory Allocation.    Program
       2. Write a program in C to demonstrate how to handle the pointers in the program.   Program

Exercise 10:
       1. Write a program in C to demonstrate the use of & (address of) and
          *(value at address)operator.   
Program
       2.write a program in C to add two numbers using pointers.   
Program

Exercise 11:
       1. Write a program in C to add numbers using call by reference.   Program
       2. Write a program in C to find the largest element using
            Dynamic Memory Allocation.        
Program

Exercise 12:
      1. Write a program in C to swap elements using call by reference.    Program
      2. Write a program in C to count the number of vowels and
          consonants in a string using a pointer.      
Program

Exercise 13:
      1. Write a program in C to show how a function returning pointer.     Program
      2. Write a C program to find sum of n elements entered by user. To
           perform this program, allocate memory dynamically using
           malloc()function.       
Program

Exercise 14:
     1. Write a C program to find sum of n elements entered by user. To
         perform this program, allocate memory dynamically using calloc( )
         function. Understand the difference between the above two programs.    
Program
     2. Write a program in C to convert decimal number to binary number
         using the function.   
Program

Exercise 15:
     1. Write a program in C to check whether a number is a prime number
         or not using the function.    
Program
     2. Write a program in C to get the largest element of an array using the function.   
Program

Exercise 16:
     1. Write a program in C to append multiple lines at the end of a text file.   Program
     2. Write a program in C to copy a file in another name.   Program
     3. Write a program in C to remove a file from the disk.   
Program


Course Outcomes:
     By the end of the Lab, the student
       1) Gains Knowledge on various concepts of a C language.
       2) Able to draw flowcharts and write algorithms.
       3) Able design and development of C problem solving skills.
       4) Able to design and develop modular programming skills.
       5) Able to trace and debug a program.


netaji gandi Monday, October 31, 2022
JNTUK A.Y 2022-23 PROGRAMMING FOR PROBLEM SOLVING USING C

 

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

 JNTUK-ECE- A.Y-2022-23

PROGRAMMING FOR PROBLEM SOLVING USING C


COURSE OBJECTIVES:

The objectives of Programming for Problem Solving Using C are

  • To learn about the computer systems, computing environments, developing of a computer program and Structure of a C Program.
  • To gain knowledge of the operators, selection, control statements and repetition in C
  • To learn about the design concepts of arrays, strings, enumerated structure and union types. To learn about their usage.
  • To assimilate about pointers, dynamic memory allocation and know the significance of Preprocessor.
  • To assimilate about File I/O and significance of functions
COURSE OUTCOMES:

On completion of this course students will be able to

S.NO.Course OutcomeKnowledge Level
CO1Describe the fundamentals of computers and comprehend the problem-solving component.Understand Level
CO2Demonstrate algorithm for the provided problem and draw flow chart.Understand Level
CO3Design and develop C program to evaluate simple expressions and logical operations.Application Level
CO4Implement C programs with suitable data types using arrays , strings and function concepts to solve the given problem.Application Level
CO5Demonstrate the concept of a pointer, file and execute I/O operationsApplication Level

SYLLABUS:

UNIT I

Introduction to Computers: Creating and running Programs, Computer Numbering System, Storing Integers, Storing Real Numbers

Introduction to the C Language: Background, C Programs, Identifiers, Types, Variable, Constants, Input/output, Programming Examples, Scope, Storage Classes and Type Qualifiers.

Structure of a C Program: Expressions Precedence and Associativity, Side Effects, Evaluating Expressions, Type Conversion Statements, Simple Programs, Command Line Arguments.



UNIT II

Bitwise Operators: Exact Size Integer Types, Logical Bitwise Operators, Shift Operators.

Selection & Making Decisions: Logical Data and Operators, Two Way Selection, Multiway Selection, More Standard Functions

Repetition: Concept of Loop, Pretest and Post-test Loops, Initialization and Updating, Event and Counter Controlled Loops, Loops in C, Other Statements Related to Looping, Looping Applications, Programming Examples


                                                                           UNIT III

Arrays: Concepts, Using Array in C, Array Application, Two Dimensional Arrays, Multidimensional Arrays, Programming ExampleCalculate Averages

Strings: String Concepts, C String, String Input / Output Functions, Arrays of Strings, String Manipulation Functions String/ Data Conversion, A Programming Example –Morse Code

Enumerated, Structure, and Union: The Type Definition (Type-def), Enumerated Types, Structure, Unions, and Programming Application


UNIT IV

Pointers: Introduction, Pointers to pointers, Compatibility, L value and R value

Pointer Applications: Arrays and Pointers, Pointer Arithmetic and Arrays, Memory Allocation Function, Array of Pointers, Programming Application

Processor Commands: Processor Commands


UNIT V

Functions: Designing, Structured Programs, Function in C, User Defined Functions, Inter- Function Communication, Standard Functions, Passing Array to Functions, Passing Pointers to Functions, Recursion

Text Input / Output: Files, Streams, Standard Library Input / Output Functions, Formatting Input / Output Functions, Character Input / Output Functions

Binary Input / Output: Text versus Binary Streams, Standard Library, Functions for Files, Converting File Type.


TEXT BOOKS:
  1. Programming for Problem Solving, Behrouz A. Forouzan, Richard F. Gilberg , CENGAGE
  2. The C Programming Language, Brian W. Kernighan, Dennis M. Ritchie,2e,Pearson
REFERENCES:
  1.  Computer Fundamentals and Programming, Sumithabha Das, McGrawHill
  2.  Programming in C, Ashok N. Kamthane,  AmitKamthane, Pearson
  3.  Computer Fundamentals and Programming in C, PradipDey, ManasGhosh,OXFORD


netaji gandi

NPTEL Programming in Java Jan 2024 Week 11

  Week 11 : Programming Assignment 1 Due on 2024-04-11, 23:59 IST The following code is missing some information needed to run the code. Add...