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 Arjun
3
votes
1
answer
1681
GATE Overflow | Programming | Test 1 | Question: 16
What is the number of tokens in the below C code? int foo(int i, int j){ return printf(" I do it correctly", i > j); }
What is the number of tokens in the below C code?int foo(int i, int j){ return printf(" I do it correctly", i j); }
966
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
compiler-tokenization
numerical-answers
+
–
11
votes
4
answers
1682
GATE Overflow | Programming | Test 1 | Question: 15
Which of the following statements produce a compile time error in C? int a = sizeof 3; *(1000) = 5; int a = 5; ((int)a)++; int b = 5, *a = &b; ((int*)a)++; 1, 2 and 3 2 only 2, 3 and 4 All 4
Which of the following statements produce a compile time error in C?int a = sizeof 3;*(1000) = 5;int a = 5; ((int)a)++;int b = 5, *a = &b; ((int*)a)++;1, 2 and 32 only2, ...
2.2k
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
+
–
6
votes
2
answers
1683
GATE Overflow | Programming | Test 1 | Question: 14
void foo(int x) { int *p = &x; *p = x*x; } The above code is supposed to modify any input integer with its square. Which of the following statements regarding the above code is correct? The given code is wrong as ... not returning any value The given code is wrong as it is illegal to access the memory of a parameter variable inside a function
void foo(int x) { int *p = &x; *p = x*x; }The above code is supposed to modify any input integer with its square. Which of the following statements regarding the above co...
951
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
parameter-passing
+
–
11
votes
2
answers
1684
GATE Overflow | Programming | Test 1 | Question: 13
What is the following function doing? unsigned int foo(unsigned int x) { unsigned int c = sizeof x; c <<= 3; if(x == 0) return c; c--; while(x = x & x-1) c--; return c; } Counting the number ... the number of set bits in the binary representation of x Counting the number of unset bits in the binary representation of x None of the above
What is the following function doing?unsigned int foo(unsigned int x) { unsigned int c = sizeof x; c <<= 3; if(x == 0) return c; c ; while(x = x & x-1) c ; return c; }Cou...
1.8k
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
identify-function
+
–
5
votes
4
answers
1685
GATE Overflow | Programming | Test 1 | Question: 12
What will be returned by the following function foo when called as foo(10)? int foo(int n) { return n & n | 1; }
What will be returned by the following function foo when called as foo(10)?int foo(int n) { return n & n | 1; }
1.4k
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
numerical-answers
bitwise
+
–
7
votes
2
answers
1686
GATE Overflow | Programming | Test 1 | Question: 11
What will be the outout of the following code? #include <stdio.h> int main() { int a = 1, b = 2; int c = a++ || b++; printf("%d %d %d", a, b, c); } 1 2 1 2 3 1 2 2 1 2 2 0
What will be the outout of the following code?#include <stdio.h int main() { int a = 1, b = 2; int c = a++ || b++; printf("%d %d %d", a, b, c); }1 2 12 3 12 2 12 2 0
936
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
short-circuit-rule
+
–
4
votes
2
answers
1687
GATE Overflow | Programming | Test 1 | Question: 10
What will be the output of the following program? #include <stdio.h> void f1(int p1, int *p2, int **p3) { p1 = 20; *p2 = p1; **p3 = *p2; p1 = 10; } int main() { int a = 5, b = 5, *c = &b; f1(a, &b, &c); printf("%d %d %d", a, b, *c); } 5 5 5 5 20 20 10 20 20 20 20 20
What will be the output of the following program?#include <stdio.h void f1(int p1, int *p2, int p3) { p1 = 20; *p2 = p1; p3 = *p2; p1 = 10; } int main() { int a = 5, b ...
838
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
pointers
+
–
3
votes
2
answers
1688
GATE Overflow | Programming | Test 1 | Question: 9
No. of times '*' will be printed by the following C code is _____ #include<stdio.h> void foo(int x) { switch(x){ case 1: printf("*"); case 2: printf("*"); case 3: printf("*"); default: printf("*"); } } int main() { foo(2.5); }
No. of times '*' will be printed by the following C code is _____#include<stdio.h void foo(int x) { switch(x){ case 1: printf("*"); case 2: printf("*"); case 3: printf("*...
1.2k
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
switch-case
numerical-answers
+
–
6
votes
2
answers
1689
GATE Overflow | Programming | Test 1 | Question: 8
What is the output of this program? #include <stdio.h> int main() { char *ptr; char string[] = "Hello 2017"; ptr = string; ptr += 4; printf("%s",++ptr); } Hello 2017 ello 2017 2017 o 2017
What is the output of this program?#include <stdio.h int main() { char *ptr; char string[] = "Hello 2017"; ptr = string; ptr += 4; printf("%s",++ptr); }Hello 2017ello 201...
679
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
pointers
+
–
9
votes
2
answers
1690
GATE Overflow | Programming | Test 1 | Question: 7
The output for the following C program will be #include <stdio.h> int temp; int new(int t) { static int cal; cal = cal + t; return(cal); } int main() { int t, p; for(t=0; t<=4; t++) p = new(t) + ++temp; printf("%d", p); } 25 20 15 Garbage Value
The output for the following C program will be#include <stdio.h int temp; int new(int t) { static int cal; cal = cal + t; return(cal); } int main() { int t, p; for(t=0; t...
1.1k
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
+
–
7
votes
3
answers
1691
GATE Overflow | Programming | Test 1 | Question: 6
The output of the following C program will be _____ #include<stdio.h> #define type int type foo(type b) { return b*b; } #undef type #define type float int main() { float a = foo(1.1); printf("%1.2f", a); }
The output of the following C program will be _____#include<stdio.h #define type int type foo(type b) { return b*b; } #undef type #define type float int main() { float a ...
1.7k
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
data-types
numerical-answers
+
–
10
votes
3
answers
1692
GATE Overflow | Programming | Test 1 | Question: 5
Consider the following usage of variable a where b is an appropriate pointer variable. int * b = &a; Which of the following declarations is invalid for a? auto int a; register int a; static int a; const int a; 1 and 2 4 only 2 only 2 and 4
Consider the following usage of variable a where b is an appropriate pointer variable.int * b = &a;Which of the following declarations is invalid for a?auto int a;registe...
1.7k
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
+
–
5
votes
3
answers
1693
GATE Overflow | Programming | Test 1 | Question: 4
Consider the following C functions: int f1(int a, int b) { while (a != b) { if(a > b) a = a - b; else b = b - a; } return a; } int f2(int a, int b) { while (b != 0) { int t = b; ... for all positive inputs but not f3 For some positive input all 3 functions return different values f2 and f3 return same value for all positive inputs but not f1
Consider the following C functions:int f1(int a, int b) { while (a != b) { if(a b) a = a - b; else b = b - a; } return a; } int f2(int a, int b) { while (b != 0) { int t...
2.6k
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
identify-function
+
–
10
votes
7
answers
1694
GATE Overflow | Programming | Test 1 | Question: 3
What will be the output of the following code? #include <stdio.h> #include <string.h> int main() { char string[] = "Hello"; if(sizeof(string) <= strlen(string)) printf("1"); printf("0"); } ______
What will be the output of the following code?#include <stdio.h #include <string.h int main() { char string[] = "Hello"; if(sizeof(string) <= strlen(string)) printf("1");...
1.9k
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming-in-c
programming
numerical-answers
+
–
8
votes
2
answers
1695
GATE Overflow | Programming | Test 1 | Question: 2
Consider the following C function: void foo() { int a[10][20][30] = {0}; __________ printf("%d", a[3][4][5]); } Which of the following could be used in the missing line so that the output is 2? a[3][4][5] = 2; *(*(*(a+3) + 4) + 5) = 2; (*(*(a ... *((int*)a + 3 * 20 * 30 + 4 * 30 + 5) = 2; Only 1 and 2 Only 1, 2 and 3 Only 1 1, 2, 3 and 4
Consider the following C function:void foo() { int a[10][20][30] = {0}; __________ printf("%d", a[3][4][5]); }Which of the following could be used in the missing line so ...
1.4k
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
pointers
+
–
4
votes
2
answers
1696
GATE Overflow | Programming | Test 1 | Question: 1
What will be the output of the following C program? #include <stdio.h> int main() { int f1(int,int); int x = 9,n = 3; printf("%d", f1(x, n)); } int f1(int x, int n) { int y = 1,i = 1; for(i = 1;i <= n; i++) y = y * x; return(y); } 27 729 81 Compilation Error
What will be the output of the following C program?#include <stdio.h int main() { int f1(int,int); int x = 9,n = 3; printf("%d", f1(x, n)); } int f1(int x, int n) { int y...
1.4k
views
asked
Oct 18, 2016
Programming in C
go-programming-1
programming
programming-in-c
+
–
4
votes
1
answer
1697
GATE Overflow | Data Structures | Test 1 | Question: 30
In a Network where bytes are continuously being transferred, it is required to identify the most frequently transferred byte. What would be an appropriate data structure for finding this? Linked List Array Dynamically growing Array Set
In a Network where bytes are continuously being transferred, it is required to identify the most frequently transferred byte. What would be an appropriate data structure ...
813
views
asked
Oct 10, 2016
DS
go-ds-1
data-structures
+
–
1
votes
2
answers
1698
GATE Overflow | Data Structures | Test 1 | Question: 29
Which of the following is false? Arrays are better than linked lists for sorting due to better data locality. Asymptotic time complxity for FindMax is same on an unsorted array as that on a singly linked list. A doubly linked list ... as of a singly linked list. Given a fixed maximum size, a circular queue is preferrable to a normal queue
Which of the following is false?Arrays are better than linked lists for sorting due to better data locality.Asymptotic time complxity for FindMax is same on an unsorted a...
911
views
asked
Oct 10, 2016
DS
go-ds-1
data-structures
array
queue
+
–
2
votes
2
answers
1699
GATE Overflow | Data Structures | Test 1 | Question: 28
What would be an appropraite data structure to represent family hierarchy where each node is an individual and there in no requirement to keep "married to" relationship? Binary Tree n-ary Tree Graph Linked List
What would be an appropraite data structure to represent family hierarchy where each node is an individual and there in no requirement to keep "married to" relationship?B...
792
views
asked
Oct 10, 2016
DS
go-ds-1
data-structures
+
–
0
votes
3
answers
1700
GATE Overflow | Data Structures | Test 1 | Question: 27
Consider a complete graph of 10 vertices. The minimum no. of edge removals required to make the graph disconnected is ______
Consider a complete graph of 10 vertices. The minimum no. of edge removals required to make the graph disconnected is ______
677
views
asked
Oct 10, 2016
DS
go-ds-1
data-structures
graph-theory
numerical-answers
+
–
Page:
« prev
1
...
80
81
82
83
84
85
86
87
88
89
90
...
98
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register