Recent questions tagged output

82
views
1 answers
1 votes
Find Output of below Code#include<stdio.h>int sum(int n) { n = 3; if (n == 2) return 2; return sum(n-1)*n ;}int main() { printf("%d\n", sum(5) ); return 0}
188
views
0 answers
0 votes
Trying out a code to get all the possible marks that can be obtained in a GATE paper.Assumptions taken : 1) All questions are MCQs (all questions have a ... t output anything.Any suggestions on where might I be going wrong/ the error lies?
3.2k
views
3 answers
7 votes
Consider the following $\mathrm{C}$ function definition.int f X(char * a) { char * b = a; while (*b) b ++; return b - a; }Which of the following ... in main (), the function call $\mathrm{fX}(\mathrm{c})$ will always return a value
7.1k
views
3 answers
5 votes
Consider the following $\mathrm{C}$ program:#include <stdio.h> int main() { int a=6; int b = 0; while (a<10) { a = a / 12+1 ; a + ... program prints $10$ as outputThe program gets stuck in an infinite loopThe program prints $6$ as output
3.9k
views
4 answers
3 votes
Consider the following $\mathrm{C}$ program:#include <stdio.h> void fX (); int main(){ fX(); return 0 };void fX () { char a; ... no outputThe program will terminate with $4321$ as outputThe program will terminate with $1234$ as output
475
views
1 answers
5 votes
What will be output printed by the following program?#include<stdio.h> main() { int c=4; switch(c) { c=c-1; case 4: ... $\text{IITB IISc IITM}$\text{IITB}$\text{IITB IITM IITD}$
664
views
2 answers
8 votes
#include <stdio.h> int main() { int i= 255; short int *s= (short int *)&i; printf("%d\n", *s); }What will be the output of the above program in little-endian and big- ... $65280,\; 0$0,\;0$0,\; 65280$
511
views
1 answers
6 votes
What will be the output of the following program?main() { int a[2][2] = { {1,2},{3,4} }; int(*p)[2][2]; p = &a; printf("%d", (*p)[0][0]); }$1$3$4$None of these
532
views
1 answers
6 votes
What will be the output of the following C program?#include<stdio.h> void main() { int i=6; for(--i; --i; i--) { printf("%d",i); } }$42$31$Infinite loopNone of these
558
views
1 answers
6 votes
What will be the output on the execution of the following code segment?main() { unsigned num1=-1; signed num2=1; if(num1 < num2) printf("less"); else ... >num2) printf("greater"); else if(num1==num2) printf("equal"); }greaterlessequalerror
1.1k
views
1 answers
3 votes
What will be the output of the following C program?#include<stdio.h> int main(){ int x=3; int y; switch(x++){ x++; case 3: printf("Three %d",x); break; case 4 ... break; default: printf("Default %d",x); } }Three $3$Four $4$Three $4$Four $5$