Recent questions tagged output

0 votes
1 answer
211
main( ){double x, d = 5.0;int y ;x = d * (x = 2.5/d);printf(“x=%lf\n”,x);x = d*(y=(int)2.5+1.5);printf("x=%lf y=%d\n",x,y);}What is output of above program?
0 votes
1 answer
212
What is the output of following program?int i ;main ( ){int j;for (; ;){if (j = function (i))printf (“j = %d \n”, j)elsebreak;}}function (x){int x ;static int v = 2;v...
7 votes
3 answers
214
What is the output of the following program?#include<stdio.h int main() { int array[]={10, 20, 30, 40}; printf(“%d”, -2[array]); return 0; }$-60$$-30$$60$Garbage valu...
0 votes
1 answer
215
0 votes
1 answer
216
#include<stdio.h int main(){ int a[] = {1, 2, 3, 4, 5, 6}; int *ptr = (int*)(&a+1); printf("%d ", *(ptr-1) ); return 0;}Give the output with explanation.
3 votes
1 answer
218
2 votes
2 answers
219
int i = 0 ;main( ){printf ( "\nmain's i = %d", i ) ;i++ ;val( ) ;printf ( "\nmain's i = %d", i ) ;val( ) ;}val( ){i = 100 ;printf ( "\nval's i = %d", i ) ;i++ ;}
1 votes
1 answer
220
#include <stdio.h>#include <conio.h>main( ){int i = 3, j = 4, k, l ;k = addmult ( i, j ) ;l = addmult ( i, j ) ;printf ( "\n%d %d", k, l ) ;}addmult ( int ii, int jj ){in...
2 votes
1 answer
222
What is the output ofmain ( ){char ch [20];int i;for (i=0; i<19; i++)*(ch +i)=67;*(ch +i)=’\0’;printf(“%S”,ch);} Prints c 18 times Prints c 19 times Prints c 1...
1 votes
2 answers
223
main { int i; printf (“Hellow \n”); For(i=1; j<=10; i++) main ( );}What is the o/p of the following program? Endless execution of code & printing Hellow co...
1 votes
1 answer
224
What is the output of following program?main ( ){union a { int i; char ch[z]; }union a,u;u∙i=256 printf (%d%d%d,u∙i,u∙ch[0],u∙ch ); } 256 1 0 255 1 0 ...
2 votes
2 answers
226
OPTIONSA)7,19 B) 10,1 C) 10,23 D)10,32
1 votes
1 answer
227
Choose the right option.#define X 8 int main(void) { cout<<++X; return 0; }A) 8 B) 9C) Garbage Value C) Compile Error
1 votes
2 answers
230
Can you see why the output of the following code is 256?main () { int a=0x1ff; char *careful= &a; *careful = 0; printf("%d", a); }
0 votes
1 answer
231
3 votes
1 answer
232
Ans given is D.I want to know the logic behind
0 votes
1 answer
233
0 votes
1 answer
234
0 votes
1 answer
235
Consider the following codeWhat is the output printed by the above code in terms of n?How it is coming b??
1 votes
2 answers
236
2 votes
2 answers
238
#include <stdio.h>int main(){int a=1 , b=3;a += b -= a-=b;printf("%d %d",a,b);}what is the output ?a. 3 4b. 3 5c. 2 4d. compilation fails
0 votes
2 answers
239
Consider the following program, what will be the output -?#include<stdio.h int main() { int a[m][n]={{1,2,3},{4,5,6}}; int i,j; for(i=0;i<m;i++) { ...
0 votes
3 answers
240
#include <stdio.h void f(int,int); int main(void){ int a = 5; f(a,a); printf("%d",a); } void f(int x, int y){ x ; y=y+15; }If copy-restore is used, then what will be the ...