Technical Questions
Technical Questions
Technical Questions
-Vishal Vanaki
Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ? A.rem = 3.14 % 2.1; B.rem = modf(3.14, 2.1); C.rem = fmod(3.14, 2.1); D.Remainder cannot be obtain in floating point division.
How would you round off a value from 1.66 to 2.0? A.ceil(1.66) B.floor(1.66) C.roundup(1.66) D.roundto(1.66)
By default a real number is treated as a A.float B.double C.long double D.far double
int char float double void Array Pointer Structure Union Enum
Which of the following is the correct order of evaluation for the below expression?
z=x+y*z/4%2-1 A.* / % + - = B.= * / % + C./ * % - + = D.* % / - + =
What will you do to treat the constant 3.14 as a long double? A.use 3.14LD B.use 3.14L C.use 3.14DL D.use 3.14LF
How many times the program will print "IndiaBIX" ? #include<stdio.h> int main() { printf("IndiaBIX"); main(); return 0; } A.Infinite times B.32767 times C.65535 times D.Till stack doesn't overflow
Specify the 2 library functions to dynamically allocate memory? A.malloc() and memalloc() B.alloc() and memalloc() C.malloc() and calloc() D.memalloc() and faralloc()
What will be the output of the program? int main() { int i=0; for(; i<=5; i++); printf("%d,", i); return 0; } A.0, 1, 2, 3, 4, 5 B.5 C.1, 2, 3, 4 D.6
#include<stdio.h> int main() { int a = 500, b = 100, c; if(!a >= 400) b = 300; c = 200; printf("b = %d c = %d\n", b, c); return 0;} A.b = 300 c = 200 B.b = 100 c = garbage C.b = 300 c = garbage D.b = 100 c = 200
#include<stdio.h> int main() { int x = 3; float y = 3.0; if(x == y) printf("x and y are equal"); else printf("x and y are not equal"); return 0; } A.x and y are equal B.x and y are not equal C.Unpredictable D.No output
#include<stdio.h> int main() { int i=4; switch(i) { default: printf("This is default\n"); case 1: printf("This is case 1\n"); break; case 2: printf("This is case 2\n"); break; case 3: printf("This is case 3\n"); } return 0; }
#define swap(a,b) a=a+b;b=a-b;a=a-b; void main() { int x=5, y=10; swap (x,y); printf(%d %dn,x,y); swap2(x,y); printf(%d %dn,x,y); } int swap2(int a, int b) { int temp; temp=a; b=a; a=temp; return 0; }
main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }
main() { printf("%x",-1<<4); }
#includestdio.h main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%c",++*p + ++*str1-32); }
void main( ) { unsigned int i=10; while (i>=0) { printf(%u,i); i--; } } How many times will the program execute? A.10 B. infinite C.9 D.3
void main() { int i =1, j =1; for (;j; printf(%d%d,)) j=j++<=5; } A.111111 B.111110 C.123456 D. gives an error
# include <stdio.h> void main( ) { int i ; for(i=0;i<=10;i++, printf (%d,i)); } A.0 to 10 B.1 to 11 C. compile error D. run time error
main() {int i=0; switch(i) {case 0: i++; printf("%d..",i); case 1: printf("%d..",i); case 1: printf("%d..",i); }}
Which of the following is not provided by the compiler? A. Constructor B. Destructor C. Contructor with one parameter D. Assignment operator
main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }
main() { printf("%p",main); }
main() { char x[10],*ptr=x; scanf(%s,x); change(&x[4]); } change(char a[]) {puts(a);} if abcdefg is input, the output will be
a two dimensional array A is declared as int A[4][2]={0}. What values would be printed after execution the following statement? printf(%d,sizeof(A));
main( ) { char *q; int j; for (j=0; j<3; j++) scanf("%s" ,(q+j)); for (j=0; j<3; j++) printf("%c" ,*(q+j)); for (j=0; j<3; j++) printf("%s" ,(q+j)); } Take i/p as MOUSE,TRACK,VIRTUAL
-Thank You