MAP

C LANGUAGE EXERCISE PROGRAM LIST


(1) Write a program that perform the addition, subtraction, division and multiplication of 2  values.
(2) Write a program to count the simple interest.
(3) Write a program that find maximum of 2 values.
(4) Write a program that interchange or swap the values of 2 variables.
(5) Write a program that find minimum and maximum out of 3 values.
(6) Write a program to interchange the value of 2 variable without using 3rd variable
(7) Write a program that take input of 5 subjects marks. Count the percentage. Print the result  for following condition
If  student has 70% or more then 70% then DISTINCTION.
If  student has percentage between 60 and 69 then FIRST CLASS.
If  student has percentage between 50 and 59 then SECOND CLASS.
If  student has percentage between 40 and 49 then PASS CLASS.
If  student has percentage less then 40  then FAIL.

(8)Write a program that take input of 5 subjects marks. If student get 40 or more then 40 then  he is PASS in that subject  otherwise FAIL print the result for following condition.
If student is pass in all  subjects  then declare PASS.
Is student is fail in 1 or 2 subject then declare ATKT.
If student is fail in more then 2 subject then declare FAIL.

(9) Write a program that perform the following output for n rows
1
1 2
1 2 3
1 2 3 4

 (10) Write a program that perform the following output for n rows
1
2 2
3 3 3
4 4 4 4

(11) Write a program that perform the following output for n rows
1 2 3 4 5 4 3 2 1
1 2 3 4    4 3 2 1
1 2 3          3 2 1
1 2                2 1
1                                              1
(12) Write a program that perform the following output for n by n matrix without using array
1   2    3   4   5
10   9    8   7  6
11 12 13 14 15
20 19 18 17 16
21 22 23 24 25


(13) Write a program that perform the following output for n rows
1
3  
5  6
8  9 10

(14) Write a program that perform the following output for n  rows
*
*
* *                  
* * *
(15) Write a program that perform the following output for n  rows
1
         1          2
      1       2         3
1        2         3         4
(16) Write a program to perform the following output for n rows
1
0        1
1        0    1
0      1  0     1
(17) Write a program to perform the following output for n rows
                                    1 *
                                    2 *  *  *
                                    3 *  *  *  * *
                                    4 *  *  *  *  *  * *
(18) Generate the value of n! factorial for n number
(19) 1+2+3+4+5+6 up to  n terms
(20) 1+3+5+7+9 up to n terms
(21) 1+2+4+5+7+8 up to n terms
(22)  X+ X2 + X3 + X4 + Xup to n terms
(23)  X/Y +  X2/Y2 + X3/Y3  up to n terms
(24) X/Y +  X2/Y + X2/Y2 +  X3/Y2 +  X3/Yup to n terms
(25) A+AR+AR2+AR3+AR4 up to n terms
(26)  1! + 2! + 3! + 4! + 5! Up to n terms
(27) 1! + 3! + 5! + 7! Up to n terms
(28)  X + X3 + X5 + X7 up to n terms
(29) X/1 + X2/22 + X3/33 + X4/44  up to n terms
(30) AB+CD+A2B2+C2D2 up to n terms
(31) Write a program to generate fibona series  0,1,1,2,3,5,8,13 up to n terms.
(32) 1*3 + (1+2) * 32  + (1+2+3)  * 33 + (1+2+3+4) 34 up to n terms
(33) 1!/2!  + 3!/4! + 5!/6!   Up  to n terms
(34) X/1!  -   X3/3!  +  X5/5!  - X7/7! Up to n terms
(35) Write a program to check whether the entered no is odd or even.
(36) Write a program to calculate the sum of odd and even number between given no of series.





(37) Write a program for following output for n no of rows( Pascal triangle)
                                                            1
                                    1                      1
            1                      2                      1
1                      3                      3                      1
                        1                      4                      6                      4                      1
(38) Write a program for following output for n no of rows.
1
0          1
1          0          1
0          1          0          1
(39) Write a program that count the area for circle, square, rectangle and triangle
         using Switch-Case control structure
(40) Write a program that take input of percentage in integer only. Print the result  for following condition using Switch-Case control structure.
If  student has 70% or more then 70% then DISTINCTION.
If  student has percentage between 60 and 69 then FIRST CLASS.
If  student has percentage between 50 and 59 then SECOND CLASS.
If  student has percentage between 40 and 49 then PASS CLASS.
If  student has percentage less then 40  then FAIL.

(41) Write a  program that take input of year in 4 digit. Determine whether the year is leap year or not.(try to solve this problem with && and or operator)

(42)Write a program that determine the grade of steel according to following condition.
            1   Hardness must be greater then 50
            2   Carbon must be less then 0.7
            3   Tensile must be greater then  5500

Take the input for above qualities through keyboard from user
Grades are decided as follows.

            Grade A if all 3 conditions are met.
            Grade B if  condition (1) and (2)  are met.
            Grade C if  condition (2) and (3)  are met.
            Grade D if  condition (1) and (3)  are met.
            Grade E if only one condition met.
            Grade F if none of conditions are met.

(43) Write a program to find maximum from 3 values using conditional operator.
(44) Write a program that generate same output as of program no (10) using break
         statement.
(45) Write a program that performs the sum of given numbers until user says no
         using Go-To statement.
(46) Write a sample program that demonstrate the use of Continue statement.
(47) Write a program that find maximum and its position from 10 number using array.
(48) Write a program that sort the value in ascending order in array.
(49) Write a program that generate the array of distinct or unique values from the array given by user.
(50) Write a program that calculates the total marks and percentage for 5 subject marks using array.
(52)Write a program that arrange the array values in reverse order.
(53) Write a program that perform the summation and subtraction of two matrices.
(54) Write a Program that perform the sum of rows and sum of column for n by n matrix
(55) Write a Program that perform the sum of rows and sum of column for m by n matrix
(55) Write a program that take the input of sales of  5 salesman  for 4 different quarter of year. Count the total sales perform by each salesman and sales performed during each quarter also perform the grand total sales.
(56) Write a program that perform the sum of diagonal elements of n by n matrix
(57) Write a program of spiral matrix using 2-D matrix.
(58) Write a function to count the simple interest..
(59) Write a function  that count compound interest.
(60) Write a function to generate the square of any given number
(61) Write a function  which should work as a power function
(62) Write a functions to count the area of circle, triangle, rectangle and square.
(63) Write a function to print any character for n no of time.
(64)  Write a function which should work as absolute function. 
(65)Write a program witch demonstrate the use of pre and post increment and decrement operator also define the use of assignment operator like +=, -= , *= , /=.
(66)Write a functions which should work like a isnum() ,isalpha() ,ischar() functions .
(67)Write a functions which should work like (1) asc() function which returns an integer value of given character(2) char() function which returns character value for given integer value.
(68)Write a function to interchange the two value a and b (Call By Reference) witch passes the 2 arguments in form of address of a and b variable with declaration like Void swap(int *, int *).
(69)Write a void function which count the area and perimeter of circle(Call By Reference) witch passes radius , address of  area variable and address of  perimeter variable with declaration like Void count(float , float *, float *)
(70)Write a function to count mean for discrete data. User has to pass only n no of values and address of first element of an array with declaration  like float mean(int *,float *)
(71)Write a function to find out maximum from of n no of values. User has to pass n no of elements and Address of first variable in an array. With declaration like int findmax(int,int *).
(72) Write a function to arrange integer values in ascending order in an array witch passes n of elements and address of  first element of  an array  with declaration like  void arrange(int,int *)
(73)Write a program that demonstrate the use of gets() and puts() .
(74)Write a program that demonstrate the use of  strcmp(), strlen(), strcpy(), strrev(), strupr(), strlwr() and strcat() built-in function.
(75)Write a program that take input of  name of 10 students  with gets() and just print them with puts() function.

(76)Write a  program or function which should work like a strlen() function.
(77)Write a  program or function which should work like a strcmp() function.
(78)Write a  program or function which should work like a strcpy() function.
(79)Write a  program or function which should work like a strcat() function.
(80)Write a  program or function which should work like a strrev() function.
(81)Write a  program or function which should work like a strupr() function.
(82)Write a  program or function which should work like a strlwr() function.
(83)Write a program that take input  names of 10 students. Arrange them in ascending order in string array.
(84)Write a program that take input paragraph of 10 lines. Count total no of word and total no of characters (Excluding blank spaces).
(85)Write a pre-processor directives which returns (1) area of circle (2) perimeter of circle
(86)Write a pre-processor directives which checks works like a (1) isdigit() (2) isalpha() functions
(87)Write a preprocessor directives which demonstrate the use of  #ifdef and  #ifndef.
(88)Write a preprocessor directives which use some symbolic directives for (&&,||,==) to operators.
(89)Write a simple program using structure that demonstrate different type of declaration of structure variable
(90)Write a program using structure that accept rollno,name and percentage of students.
(91)Write a program that demonstrate the use of aray of structure variable
(92)Write a program that demonstrate how one structure variable can be copied into another
(93)Write a program that demonstrate the use of structure and function.
(94)Write a program that access the structure variable using pointer.
(95)Write a program that demonstrate the use of nested structure. For example
struct marks                                               struct student
{                                                                {
int s1;                                                        int rollno;
int s2;                                                        char name[20];
int s3;                                                        struct mark m1;
int tota;                                                      }s1;
};
(96)Write a program that demonstrate the use of getch(),getche(),getchar() and putchar() functions.
(97) Write a program that demonstrate the use of formatted input with
(%[  ]) operator.
(98)Write a program that demonstrate the use of formatted output like
printf("%10d",rollno); ,printf("%10.2f",salary) and printf("%*.*s",10,5,name)
(99)Write a simple program that explain the precedence(priority) and associativity.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More