Recent questions tagged tbb-programming-2

3 votes
1 answer
1
Assume that $a[4]$ is a one-dimensional array of $4$ elements, $p$ is a pointer variable and $p = a$ is performed. Now, which among these expressions is illegal?$p == a[0...
0 votes
1 answer
2
0 votes
1 answer
3
#include<stdio.h int K = 10; int main() { foo(); foo(); return 0; } int foo() { static int k= 1; printf("%d ",k); k++; return 0; }What is the output of the above code sni...
0 votes
1 answer
4
What is the output of the following program? int fun (int z) { if( z==0 || z==1 ) return 1; else return fun(z-1) ; } int main() { int y; y=fun(8); printf(“%d”...
2 votes
1 answer
5
1 votes
1 answer
6
Read the following program fragment: #include<stdio.h int main() { int p = 2, q = 5; p = p^q; q = q^p; printf("%d%d",p,q); return 0; }The output is:$5 \ 2$$2 \ 5$$7...
0 votes
0 answers
7
1 votes
1 answer
8
What is the output of the following program?#include <stdio.h int main() { int a = 0; switch(a) { default: a = 4; case 6: a ; case 5: a = a+1; case 1: a = a-1; } printf("...
4 votes
3 answers
9
Read this code snippet :void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf(" GATE 2018\n"); else printf("Forget GATE\n"); }The output is :Compiler ErrorForge...
7 votes
2 answers
10
What is the output of the following code snippet? #include <stdio.h int main() { char c=125; c=c+10; printf("%d",c); return 0; }
0 votes
1 answer
11
How many TOKENS are there in the statement answer $=(5*q-p*p)/3$; ?$13$$12$$15$$14$
2 votes
1 answer
12
The output of this code snippet is :#include <stdio.h #define x 4+1 int main() { int i; i = x*x*x; printf("%d",i); return 0; }
1 votes
1 answer
14
What will be the output of the below program ?#include <stdio.h int main() { struct node { int x; int y; int z; }; struct node s = { 3, 5, 6 }; struct node *pt = &s; prin...
7 votes
2 answers
15
What will be the output of this program ?#define square(x) x*x main() { int z; z = 25/square(5); printf("%d",z); }
3 votes
1 answer
16
Choose the correct operators to fill in the blanks:int i,j,k; i=1;j=2;k=3; printf("%d",i___5___j___2____k);Output is: $2$ + % – +* / – ++ % + /* % – /
0 votes
1 answer
17
6 votes
4 answers
18
What is the output of the code? #include <stdio.h int main() { int a; printf("%d",scanf("%d",&a)); return 0; }$10$$9$$-1$An undefined behavior
0 votes
1 answer
21
Suppose the following declarations are in effect :$\text{int }a[ \: ] = \{5,15,34,54,14,2,52,72 \}$;$\text{int }*p = \&a , *q = \&a[5]$;The value of $q - p$ is ________...
2 votes
1 answer
22
2 votes
2 answers
23
What is the output of this program?#include <stdio.h int main() { char *ptr; char string[] = "How are you?"; ptr = string; ptr += 4; printf("%s",ptr); return 0; }How are ...
0 votes
1 answer
24
The value of p after execution of the following program will be:int new(int t) { static int cal=0; cal=cal+t; return(cal); } main() { int t,p; for(t=0;t<=4;t++) p= new(t)...
0 votes
0 answers
25
4 votes
2 answers
27
0 votes
1 answer
28
What is the output of this program?#include <stdio.h #include <string.h int main() { char string[] = "Hello"; printf("%lu %lu", sizeof(string), strlen(string)); return 0;...
1 votes
1 answer
30
To see more, click for the full list of questions or popular tags.