C PROGRAMMING LAB PROGRAMS

BATHULA PRAVEEN (BP)
0

           



C PROGRAMMING LAB PROGRAMS 

EXPERIMENT - 1

Construct Flowcharts for the following through Raptor:

 i) Develop a calculator to convert time, distance, area, volume and temperature from one unit to another. ii) Calculate simple and compound interest for various parameters specified by the user.

 iii) Calculate the average of n numbers.

EXPERIMENT - 2

A) Write a c program to calculate the area of triangle using the formula Area= (s*(s-a) *(s-b) *(s-c))/2 Where s= (a+b+c)/2

B) Write a c program to find the largest of three numbers using ternary operator.

C) Write a c program to swap two numbers without using a temporary variable.

EXPERIMENT - 3

A) Write a C Program to Find Roots of a Quadratic Equation An equation of degree 2 is known as a quadratic equation. If you’re not familiar with the term ‘degree’, it is an order of an equation and its value is equal to the largest exponent present in an equation. Degree Equation 1 Linear 2 Quadratic 3 Cubic

B) Write a C program which takes two integer operands and one operator from user and perform the operation and prints the result (Consider the operators + - * / % and use switch statement

EXPERIMENT - 4

A) Write a C program to find the sum of individual digits of a positive integer and find the reverse of the given number.

B) Write a C program to generate all the prime numbers between 1 and n, where n is a value supplied by the user.

EXPERIMENT - 5

A) Write a C Program to print the multiplication table of a given number n up to a given value, where n is entered by the user.

B) Write a C Program to enter a decimal number, and calculate and display the binary equivalent of that number.

C) Write a C Program to check whether the given number is Armstrong number or not.

 Eg: 153 = (1)3 + (5)3 + (3)3 153 = 1 + 125 + 27 153 = 153

EXPERIMENT - 6

A) Write a C program to interchange the largest and smallest numbers in the array.

B) Write a C program to input two m x n matrices, check the compatibility and perform addition and multiplication of them.

EXPERIMENT - 7

a) Write a C Program to find sum of following series for a given n value.

i. 1+(1+2)+(1+2+3)+(1+2+3+4)+(1+2+3+4+5)+...+(1+2+...+n). 

ii. 1+(2+2)+(3+3+3)+(4+4+4+4)+…+(n+n+n+n..+n).

b) Write a C Program to display following patterns for a given n value

i.      1 

       2 2 

      3 3 3                   if n =3

ii.   1 

     2 2

    3 3 3 

      2 2 

       1                     if n=3.

EXPERIMENT - 8

Draw a flow chart using Raptor and write C programs that use both recursive and non-recursive Functions for the following

i) To find the factorial of a given integer

ii) To find the GCD greatest common divisor of two given integers

                                EXPERIMENT - 9

a) Write a C Program to find Fibonacci sequence.

b) Write C programs illustrating call by value and call by reference concepts

                               EXPERIMENT - 10

Write C Programs for the following string operations without using the built in functions - to concatenate two strings

a) To append a string to another string

B) To compare two strings

                               EXPERIMENT - 11

Write C Programs for the following string operations without using the built in functions

A) To find whether a given string is palindrome or not

b) Write a C Program to count number of occurrences of each character in a given string. Example: if input ‘APPLE’ then output is ‘A count 1, P count 2, L count 1, E count 1’

                             EXPERIMENT - 12

Write a C program that uses functions to perform the following operations:

a) To insert a sub-string in to given main string from a given position

b) To delete n Characters from a given position in a given string.

C) To replace a character of string either from beginning or ending or at a specified location

                            EXPERIMENT - 13

A) Write a C program to implement Taylor series method

B) Write a C program to implement Euler’s method

C) Write a C program to implement Runge kutta method

                           EXPERIMENT - 14

A) Write C Program to reverse a string using pointers

B) Write a C Program to compare two arrays using pointers

C) Write a C program to swap two numbers using pointers

                          EXPERIMENT - 15

i. Accept size of array from user then read n elements into two arrays and store sum of those two arrays in third array, display three arrays using pointers

ii. User will specify data type and data to store, use generic pointer to store that data and display given input

                         EXPERIMENT - 16

Examples which explores the use of structures, union and other user defined variables

                        EXPERIMENT - 17

A) Write a C program which copies one file to another.

b) Write a C program to count the number of characters and number of lines in a file.

c) Write a C Program to merge two files into a third file. The names of the files must be entered using command line arguments



Tags

Post a Comment

0Comments

Post a Comment (0)