Sunday 13 November 2011

20 cprogramming interview questions

This question papers have also important question from mca 2005 model papers.
based on  that try to solve program execute and store the code in your machine.this sampls help you in cprogramming interview also.
1) main( )
{
int c=40 ;
 printf ("%d %d %d %d    c , c«l»2, c&lO, c|100);
)
2) #include <stdio.h>
int a, i = 3; fsum = 0;
main( )
{
for ( ; i>2 ; -i) 1
fsum = fsum + fact(i);
}
printf ("%d \n %d\ i, fsum); i
1
fact(i)
{ if(i==D
return(l);
else
return (i * fact(i-l));
}



3) main( )
{
inta[3]= {1,2, 3.4,5);
printf("%d \n %d \n %d \n %d \n %d'\ a.a+l.a+2,a+3,a+4);
4) main( )
 (
 int x = 5, y = 10; y+= ++x, ++y, x++; x+=y++;
printf("x=%d\n y=%d", x.y);

5) main( )
I char str[] = "computer"; printf("%s \n %s", str, strrev(str, 2)); }
6) main( )
{
int z = 30;
printf("%d %d %d %d'\ z. z«2»3, Z&100, z|10); I
7) muin( )
( int sum, index; sum = 0; index = 9; do | index+=l:
sum = 2* sum; | while(index>9); printf("r/cd %d'\ sum. index): )


8) # define SQUARE (X) (X * X)
main ()
j   int   a = 3, b ;
b =   SQUARE (a + 1); Printf (" % d", b);
)
9) main ()
{    int a = 8 , b = 4   c = 2 ;
a = b » c ;
b = a « c ;
c = c « a » b ; printf ("a = % d \ n b = % d\n c = % d", a, b, c);

}
10) main ()
{    int a;
printf (" % d \ n % d   scanf (" % d", & a), scanf ("%dM, & a)); }
p.T.a




11) main ()
{   int  x = 1, y = 1 ; for<;;)
'' *'    < If (x>5) break ;
else
y = y + x ; printf("%d\y); x=x+y;
}
)
12) main ( )
{   int a[ ] = (2,4,6,8,10); int i;
change (a, 5); for (i = 0 ; i< = 4 ; i + +) printff %d",a[i]);

change (int * b, int n) { int i;
for (i = 0 ; i < n ; i ++) * (b + i) = * (b + i) + 5 ; )



3. Write a program to accept student information (Rollno, name, percentage) for 8 students and display merit list.
4. A) Write a program to display sum of digits of a given number. Use recursion.
B) Write a program to concatenate two given strings without using built-in string functions.
5. Write a program to read the data from DATA.txt file, display every alternate word and total no. of words from file.
6. A) Write program to draw 'n' concentric circles, accept n' from user.

B) Write program to accept 5x5 matrix and display sum of diagonal elements.
7. Write a program to encrypt a text File using 'key'. Accept file name and key as a command line argument.
8. A) Write a program to swap the two strings. Use function swap (char *, char *).

B) Write a program to accept a number and display it's equivalent Hexadecimal number.
9. Write short note on :
A) Storage classes
B) 'C preprocessor.



10. Write a program to accept student information (Rollno, name, percentage) for 10 students and display merit list. Use suitable format.
11. A) Write a program to display sum of digits of a given number. Use recursion.
12) How to Write a program to concatenate two given strings without using built-in string functions.
13.How to Write a program to read the data from DATA.txt file, display every alternate word and total no. of words from file.
15. A) How to Write program to draw 'n' concentric circles, accept n' from user.

16) How to Write program to accept 5x5 matrix and display sum of diagonal elements.
17.How to Write a program to encrypt a text File using 'key'. Accept file name and key as a command line argument.
18.How to A) Write a program to swap the two strings. Use function swap (char *, char *).

19) How to  Write a program to accept a number and display it's equivalent Hexadecimal number.
20)what is Storage classes
21)C preprocessor.
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: