Tag Archives: C

Write a program in ‘C’ for the addition of two polynomials. Use Arrays and Structures. 10m Dec2006

Write a program in ‘C’ for the addition of two polynomials. Use Arrays and Structures. 10m Dec2006 #include<stdio.h> void main() { int poly1[6][2],poly2[6][2],term1,term2,match,proceed,i,j; printf(“Enter the number of terms in first polynomial : “); scanf(“%d”,&term1); printf(“Enter the number of terms in second polynomial : “); scanf(“%d”,&term2); printf(“Enter the coeff and expo of the first polynomial:\n”); for(i=0;i<term1;i++)… Read More »

Design an algorithm, draw a corresponding flow chart and write a program in C, to print the Fibonacci series.10m Jun2006

Design an algorithm, draw a corresponding flow chart and write a program in C, to print the Fibonacci series.10m Jun2006 An algorithm is a finite set of steps defining the solution of a particular problem. An algorithm is expressed in pseudo code – something resembling C language or Pascal, but with some statements in English… Read More »

A C program contains the following declarations: 10m Jun2006

A C program contains the following declarations: 10m Jun2006 int i, j; long iX; short S; float X; double dX; char C; Determine the resultant data type of each of the following expressions: (i) i + C                        – int (resultant data type) (ii) X + C                     – float (resultant data type) (iii) dX + X                … Read More »

Summarize the purpose of the format strings (like %s, %d, %c) that are’ commonly used within the printf function, with an example for each.10m Jun2006

Summarize the purpose of the format strings (like %s, %d, %c) that are’ commonly used within the printf function, with an example for each.10m Jun2006 If printf function format includes format specifiers (subsequences beginning with %), the additional arguments following format are formatted and inserted in the resulting string replacing their respective specifiers. It can… Read More »

Design an algorithm, draw a corresponding flowchart and write a C program to check whether a given string is a palindrome or not. 10m Jun2006

Design an algorithm, draw a corresponding flowchart and write a C program to check whether a given string is a palindrome or not. 10m Jun2006 An algorithm is a finite set of steps defining the solution of a particular problem. An algorithm is expressed in pseudo code – something resembling C language or Pascal, but… Read More »

Write a Menu driven program in C to add, subtract add multiply two distances which are given in feet and inches. 10m Dec2005

Write a Menu driven program in C to add, subtract add multiply two distances which are given in feet and inches. [e.g. 3 ft 9 inches + 2 ft 5 inches=6 ft 2 inches]. 10m Dec2005 #include<stdio.h> struct LENGTH {     int FEET;     int INCH; }; void main() {  int I;  struct LENGTH A,B;… Read More »

Write a recursive program in ‘C’ to find whether a given five digit number is a palindrome or not. 10m Dec2005

Write a recursive program in ‘C’ to find whether a given five digit number is a palindrome or not. 10m Dec2005 #include<stdio.h> int flag=0; void palin(int,int*); void main() { int a; clrscr(); printf(“Enter the number “); scanf(“%d”,&a); palin(a,&a); if(flag==0) printf(“\nThe number is palindrome…”); else printf(“\nThe number is not palindrome…”); getch(); } void palin(int x,int* y)… Read More »

Write a program in ‘C’ to print automorphic numbers. The automorphic number is a number in which the square of the number contains the number in the end. 10m Dec2005

Write a program in ‘C’ to print automorphic numbers. The automorphic number is a number in which the square of the number contains the number in the end. Example: (a) 5; 25 (b) 6; 36. 10m Dec2005 #include<stdio.h> void main() {   int SQ,i,NUM;   clrscr();   printf(“AUTOMORPHIC NUMBERS BETWEEN 0 TO 999 ARE :… Read More »

Write a program in ‘C’ to find the length of a given string including blank spaces, tabs and other special symbols use “Pointers” concept. 10m Dec2005

Write a program in ‘C’ to find the length of a given string including blank spaces, tabs and other special symbols (new line character should be taken as a string terminating character) Note : You should use “Pointers” concept. 10m Dec2005   Use while(str[i] != “\n”)  instead of while(*str)   Solved program can be found… Read More »

Explain the important features of ‘C’ language. Mention the types of applications which can be developed using C. List any three ‘C’ compilers. 10m Dec2005

Explain the important features of ‘C’ language. Mention the types of applications which can be developed using C. List any three ‘C’ compilers. 10m Dec2005  Features of ‘C’ language:- C is a general purpose, structured programming language. C programming is widely used in computer Technology.  ·         Low Level Features: C programming provides Low level features… Read More »