C Interview Questions
Questions Answers Views Company eMail

write a program to display the numbers in the following 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4

1 1660

write a program to display the numbers in the following format 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 4

NIIT, IBM, Winit,

9 6557

what is the output of the program and explain why?? #include void main ( ) { int k=4,j=0: switch (k) { case 3; j=300; case 4: j=400: case 5: j=500; } printf (“%d\n”,j); }

Oracle,

14 7657




What is the real time usage volatile?

Polycom,

2 3529

what are the stoge class in C and tel the scope and life time of it?

Tech Mahindra,

2 3205

What will be the result of the following program? char*g() { static char x[1024]; return x; } main() { char*g1="First String"; strcpy(g(),g1); g1=g(); strcpy(g1,"Second String"); printf("Answer is:%s", g()); } (A) Answer is: First String (B) Answer is: Second String (C) Run time Error/Core Dump (D) None of these

Oracle,

2 4316

. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The value of b[-1] is (A) 1 (B) 3 (C) -6 (D) none

Oracle,

9 9329

Given a piece of code int x[10]; int *ab; ab=x; To access the 6th element of the array which of the following is incorrect? (A) *(x+5) (B) x[5] (C) ab[5] (D) *(*ab+5} .

Oracle,

2 5061




What is the output of the following progarm? #include main( ) { int x,y=10; x=4; y=fact(x); printf(“%d\n”,y); } unsigned int fact(int x) { return(x*fact(x-1)); } A. 24 B. 10 C. 4 D. none

2 3218

What is the o/p of the follow pgm? #include main() { char char_arr[5]=”ORACL”; char c=’E’; prinf(“%s\n”,strcat(char_arr,c)); } a:oracle b. oracl c.e d.none

Oracle,

2 2794

#include main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a; Printf(“%d\n”, ++*I); Printf(“%d\n”, *++I); Printf(“%d\n”, (*I)--); Printf(“%d\n”, *I); } what is the o/p a. 101,200,200,199 b. 200,201,201,100 c. 101,200,199,199 d. 200,300,200,100

1 2860

What is 'makefile' in C langauage? How it be useful? How to write a makefile to a particular program?

2 5805

Is main() is used in the program,,see below example? void main() { int i; for(i=0;i<10;i++) main(); } Then what is the output of the program?

6 2979

What is the output for the below program? void main() { float me=1.1; double you=1.1; if(me==you) printf("love c"); else printf("know c"); }

7 4403

What is the output of the below program and how it is? void main() { static int var=5; printf("%d",var--); if(var) main(); }

TCS, Tech Mahindra, MindFire,

7 11612


Post New C Questions






Un-Answered Questions { C }

write a program in c language to print your bio-data on the screen by using functions.

5307


write a program to rearrange the array such way that all even elements should come first and next come odd

943


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

1019


why wipro wase

1028


find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

1001






write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

1435


How do we make a global variable accessible across files? Explain the extern keyword?

653


You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.

977


cavium networks written test pattern ..

2119


hi any body pls give me company name interview conduct "c" language only

801


write a c program in such a way that if we enter the today date the output should be next day's date.

897


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

1604


ATM machine and railway reservation class/object diagram

4013


a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

789


number of times a digit is present in a number

756