Anda di halaman 1dari 5

C Questions Exam date :19.06.2008 1.find correct declaration : int num{50} Ans : int num[50]; 2.if val1=-6.5,val2=6.

5 Printf(%d %d,ceil(val1),ceil(val2)); Printf(%d %d,floor(val1),floor(val2)); } Options: 1. -7 6 -6 -6 2.-6 7 -7 6 3. -6 7 -7 6 And like..check for ceil and floor function.. 3. which one is incorrect in switch? Options: 1. case ABC: 2. case a: 3. case 37: 4. case (q-1<5): 4.#define MAX_NUM 15 MAX_NUM is what? 1. a preprocessor 2. an integer constant 3. a compiler 4. 4. macro processor 5.main() { float x,y; y=(float) 6/5; x=y*3; printf(%d,(int)x); } 1. 0 2. 3 3. 3.0 4. None 5. 3.6 6. program flowchart is data flow throughout the program option: True/ False

7.how to print 5.0 to the power 3 is 125 options: 1. printf(5.0 to the power of 3 is,5*5*5); 2. printf(%f to power of 3 is %f,5.0,125.0); and other. 8. x=-b+bb+2-4ab how to write in program ans: -b+(b*b)+2-4*a*b 9.a function call itself is called options 1. iterative 2. recursive and blah blah.. 10. int a=5,b=4,c=3,big; big=a>b?a>c?b>c:a:b:c.. check this in ternary operator section 11.default is always written in switch statement true/false 12. #include <stdio.h> main() { char * str = "hello"; /* Accenture written here instead of hello char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); } options: 1. 0 Ans 2. 127. 3. 128 13.progarm to arrange the operators in order of precidence..relational, arithmetic and assignment

14.12.225 will be written in exponential form as option 1. 1.22e1 2. 12.22e1 3. 12.22e2 15. macro are always written in capital letters true/ false 16. int=323 ( some value given). find error? 17. char txt[20]. how many bytes will be allocated 1.20 2. 21 3. 22 18.int a=200,b,c; if(a==100) b=200; c=300; printf(%d%d,b,c); options: 1. b=200,c=200 2. b will have garbage and c has 300 and blah blah 19.printf can be implemented by options: dont remember Ans;. variable length arguments 20. Syntax error is detected by options: 1. compiler 2.linker and blah blah. 21. void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); } Ans : here in 3 6( Exploring c questionscheck)

22 Emp_name age while Varrouns_cum how many are correct for variable name? 23.main() { int val1=10,val2=20; int n; n=val1,val2?(val1,val2)?val1:val2:val2 printf(%d%d,val1,val2); } options1. 0 10 2. 10 0 3. 10 20 4. 0 20 Note: u need to print val1 and val2 so need to take care of n 24.which is correct in following 1. blank spaces may be inserted between integers 2. blank spaces cant be inserted and dont remember 25 float f=1.1 double d=1.1 if (f==d) printf(softwar e engineer); else printf(tester) options: 1. tester 2.software engineer

26. find errors main() { int arr[10]; for(subscript=0,subscript<10;subscript++) { printf(%d,arr[subscript]) } options were given with check boxesso check this 27. main() { int cnt=0; for(cnt=0;cnt<=10;cnt++);{ printf(%d,cnt); } option.. 1. cnt is 11 2.cnt is 10 3. no out put 28 main() { int x=5,j=2; junk(x,j); printf(%d%d,x,j); } junk(&amp;i,&amp;j) { i=i*i; j=j*j; } whats the o/p?