Which of the following is not an infinite loop ?a.while(1){....}b.for(;;){...}c.x=0;do{/*x unaltered within the loop*/...}while(x==0);d.# define TRUE 0while(TRUE){....}
D
Read the folllowing code# define MAX 100# define MIN 100........if(x>MAX)x=1;else if(x
D
A memory of 20 bytes is allocated to a string declared as char *sthen the following two statements are executed:s="Etrance"l=strlen(s);what is the value of l ?a.20b.8c.9d.21
C
Given the piece of codeint a[50];int *pa;pa=a;to access the 6th element of the array which of the following is incorrect?a.*(a+5)b.a[5]c.pa[5]d.*(*pa + 5)
A
Regarding the scope of the varibles;identify the incorrect statement:a.automatic variables are automatically initialised to 0b.static variables are are automatically initialised to 0c.the address of a register variable is not accessiabled.static variables cannot be initialised with any expression
B
Cond 1?cond 2?cond 3?:exp 1:exp 2:exp 3:exp 4;is equivalent to which of the following?a.if cond 1exp 1;else if cond 2exp 2;else if cond 3exp 3;elseexp 4;b.if cond 1if cond 2if cond 3exp 1;else exp 2;else exp 3;else exp 4;c.if cond 1 && cond 2 && cond 3exp 1 |exp 2|exp 3|exp 4; d.if cond 3exp 1;else if cond 2exp 2;else if cond 3exp 3;elseexp 4;
D
B
Latest Answer: I think value of y = 5.Because if you format the code, it will look like thisx = 10;y=5;if (x==10){}else if(x==9){}else{ y=8;}Since value of x is 10 so condition if (x==10) will satisfy. And there is no assignment for y. So value of y ...
What does the following code do?fn(int n,int p,int r){static int a=p;switch(n){case 4:a+=a*r;case 3:a+=a*r;case 2:a+=a*r;case 1:a+=a*r;}}a.computes simple interest for one yearb.computes amount on compound interest for 1 to 4 yearsc.computes simple interest for four year d.computes compound interst for 1 year
B
What is incorrect among teh followingA recursive functiiona.calls itselfb.is equivalent to a loopc.has a termination condd.does not have a return value at all
B
Which of the following go out of the loopo if expn 2 becoming falsea.while(expn 1){...if(expn 2)continue;}b.while(!expn 1){if(expn 2)continue;...}c.do{..if(expn 1)continue;..}while(expn 2);d.while(!expn 2){if(expn 1)continue;..}
C
View page << Previous 4 5 6 7 [8] 9 Next >>

Go Top