Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Filter
Profile
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
Questions by Bikram
3
votes
1
answer
151
Test by Bikram | Programming | Test 2 | Question: 30
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]$ $p == \&a[0]$ $^*p == a[0]$ $p[0] == a[0]$
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...
436
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
0
votes
1
answer
152
Test by Bikram | Programming | Test 2 | Question: 29
Spot the error(s) in this code snippet : int n=2; // Line 1 switch(n) { case 1.5: printf( "gate"); break; case 2: printf( "overflow"); break; case 'A': printf("gateoverflow"); } // Line 12 The error(s) is in line number _____.
Spot the error(s) in this code snippet :int n=2; // Line 1 switch(n) { case 1.5: printf( "gate"); break; case 2: printf( "overflow"); break; case 'A': printf("gateoverflo...
377
views
asked
May 14, 2017
Programming in C
tbb-programming-2
numerical-answers
+
–
0
votes
1
answer
153
Test by Bikram | Programming | Test 2 | Question: 28
#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 snippet? $2,3$ $1,2$ $1,3$ $2,4$
#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...
232
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
0
votes
1
answer
154
Test by Bikram | Programming | Test 2 | Question: 27
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”, y) ; } $1$ $36$ $8$ $40$
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”...
225
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
2
votes
1
answer
155
Test by Bikram | Programming | Test 2 | Question: 26
What is the output of the below mentioned code snippet? #include <stdio.h> int main() { int i=10; static int x=i; if(x==i) printf("Equal"); else if(x>i) printf("Greater"); else printf("Lesser"); return 0; } Equal Greater Lesser Compilation Error
What is the output of the below mentioned code snippet?#include <stdio.h int main() { int i=10; static int x=i; if(x==i) printf("Equal"); else if(x>i) printf("Greater"); ...
771
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
1
votes
1
answer
156
Test by Bikram | Programming | Test 2 | Question: 25
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 \ 7$ $7 \ 2$
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...
431
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
0
votes
0
answers
157
Test by Bikram | Programming | Test 2 | Question: 24
#include <stdio.h> int counter(int i) { static int count = 0; count = count + i; return count; } int main() { int i, j; for (i = 0; i <= 5; i++) j = counter(i); printf ("%d\n", j); return 0; } What is the output of the above program?
#include <stdio.h int counter(int i) { static int count = 0; count = count + i; return count; } int main() { int i, j; for (i = 0; i <= 5; i++) j = counter(i); printf ("%...
216
views
asked
May 14, 2017
Programming in C
tbb-programming-2
numerical-answers
+
–
1
votes
1
answer
158
Test by Bikram | Programming | Test 2 | Question: 23
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("%d \n",a); return 0; }
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("...
322
views
asked
May 14, 2017
Programming in C
tbb-programming-2
numerical-answers
+
–
4
votes
3
answers
159
Test by Bikram | Programming | Test 2 | Question: 22
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 Error Forget GATE GATE $2018$ Runtime error
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...
740
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
7
votes
2
answers
160
Test by Bikram | Programming | Test 2 | Question: 21
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; }
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; }
568
views
asked
May 14, 2017
Programming in C
tbb-programming-2
numerical-answers
+
–
0
votes
1
answer
161
Test by Bikram | Programming | Test 2 | Question: 20
How many TOKENS are there in the statement answer $=(5*q-p*p)/3$; ? $13$ $12$ $15$ $14$
How many TOKENS are there in the statement answer $=(5*q-p*p)/3$; ?$13$$12$$15$$14$
261
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
2
votes
1
answer
162
Test by Bikram | Programming | Test 2 | Question: 19
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; }
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; }
218
views
asked
May 14, 2017
Programming in C
tbb-programming-2
numerical-answers
+
–
3
votes
1
answer
163
Test by Bikram | Programming | Test 2 | Question: 18
Point out the error : #include <stdio.h> void f(int*); int main() { int i=35,*z; z=f(&i); printf("%d",z); return 0; } void f(int*m) { return(m+2); } error in function call error in return statement error in argument of f() error in pointer initialization
Point out the error : #include <stdio.h void f(int*); int main() { int i=35,*z; z=f(&i); printf("%d",z); return 0; } void f(int*m) { return(m+2); }error in function calle...
563
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
1
votes
1
answer
164
Test by Bikram | Programming | Test 2 | Question: 17
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; printf("%d\n", *((int*)pt+1)); return 0; } 5 3 7 6
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...
298
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
7
votes
2
answers
165
Test by Bikram | Programming | Test 2 | Question: 16
What will be the output of this program ? #define square(x) x*x main() { int z; z = 25/square(5); printf("%d",z); }
What will be the output of this program ?#define square(x) x*x main() { int z; z = 25/square(5); printf("%d",z); }
382
views
asked
May 14, 2017
Programming in C
tbb-programming-2
numerical-answers
+
–
3
votes
1
answer
166
Test by Bikram | Programming | Test 2 | Question: 15
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$ + % – + * / – + + % + / * % – /
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$ + % – +* / – ++ % + /* % – /
329
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
0
votes
1
answer
167
Test by Bikram | Programming | Test 2 | Question: 14
Read the following code fragment: #include <stdio.h> main() { int i=1,j; int k= 1__ (j ___ i) ; printf("%d%d%d\n", i,j,k); } What operators are needed in the blanks to print $1 \ 1 \ 2$? $*$ and $=$ $*$ and $+$ $+$ and $*$ $+$ and $=$
Read the following code fragment:#include <stdio.h main() { int i=1,j; int k= 1__ (j ___ i) ; printf("%d%d%d\n", i,j,k); }What operators are needed in the blanks to print...
282
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
6
votes
4
answers
168
Test by Bikram | Programming | Test 2 | Question: 13
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
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
923
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
3
votes
2
answers
169
Test by Bikram | Programming | Test 2 | Question: 12
What is the output of the following program? #include <stdio.h> void f(char**); int main() { char *argv[] = { "ab", "cd", "ef", "gh", "ij", "kl" }; f(argv); return 0; } void f(char **p) { char *t; t = (p += sizeof(int))[-1]; printf("%s\n", t); } ab cd ef gh
What is the output of the following program?#include <stdio.h void f(char ); int main() { char *argv[] = { "ab", "cd", "ef", "gh", "ij", "kl" }; f(argv); return 0; } void...
737
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
0
votes
1
answer
170
Test by Bikram | Programming | Test 2 | Question: 11
Which of the following will print the value $2$ for this code snippet? #include<stdio.h> int main() { int arr[10][20][30] = {0}; arr[5][2][1] = 2; __________ // missing line here return 0; } The missing line above is: printf("%d",*(( ... 5)+2)+1); printf("%d",*(*(*(arr+5)+2)+1)); printf("%d", *(*((arr+5)+2)+1);
Which of the following will print the value $2$ for this code snippet?#include<stdio.h int main() { int arr[10][20][30] = {0}; arr[5] = 2; __________ // missing line he...
219
views
asked
May 14, 2017
Programming in C
tbb-programming-2
+
–
Page:
« prev
1
...
3
4
5
6
7
8
9
10
11
12
13
...
43
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register