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
Answers by sumit kumar
3
votes
1
which of the following is correct
which of the following is correct?
which of the following is correct?
1.2k
views
answered
May 18, 2015
Algorithms
logarithmic-function
normal
+
–
2
votes
2
GATE CSE 2013 | Question: 26
The line graph $L(G)$ of a simple graph $G$ is defined as follows: There is exactly one vertex $v(e)$ in $L(G)$ for each edge $e$ in $G$. For any two edges $e$ and $e'$ in $G$, $L(G)$ has an edge between $v(e)$ and $v(e')$, if and only if ... planar graph is planar. (S) The line graph of a tree is a tree. $P$ only $P$ and $R$ only $R$ only $P, Q$ and $S$ only
The line graph $L(G)$ of a simple graph $G$ is defined as follows:There is exactly one vertex $v(e)$ in $L(G)$ for each edge $e$ in $G$.For any two edges $e$ and $e'$ in ...
19.3k
views
answered
Apr 19, 2015
Graph Theory
gatecse-2013
graph-theory
normal
graph-connectivity
+
–
3
votes
3
according to me answer should be 3. give correct explanation.
362
views
answered
Dec 21, 2014
Compiler Design
compiler-design
context-free-grammar
numerical-answers
test-series
+
–
1
votes
4
Consider the following program
int i = 1; int main() { int a[]= { 0,1, 2} ; f(a[i], i); printf("%d", a[i]); } void f(int x, int y) { y++; x=5*i; } In above function f() uses " call by name" technique, what is the output printed? a) 2 b) 10 c) 5 d) 1
int i = 1; int main() { int a[]= { 0,1, 2} ; f(a[i], i); printf("%d", a[i]); } void f(int x, int y) { y++; x=5*i; }In above function f() uses " call by name" technique, w...
993
views
answered
Dec 11, 2014
Programming in C
programming
parameter-passing
+
–
0
votes
5
Consider the following code
void main() { int x=10, y=5; swap(x,y); print(x,y); } void swap(int a, int b) { int c, x=0; c=a; a=b; b=c; } what is output using call by text? a) 5 0 b) 5 10 c) 10 0 d) 10 10
void main() { int x=10, y=5; swap(x,y); print(x,y); } void swap(int a, int b) { int c, x=0; c=a; a=b; b=c; }what is output using call by text?a) 5 0b) 5 10c) 10 0d) ...
527
views
answered
Dec 11, 2014
Programming in C
programming
parameter-passing
+
–
1
votes
6
Self doubt
Consider the following C code: char A[20]; A="gate"; Which of the following is correct? a) '\0' is automatically appended at the end of "gate". b) '\0' is not stored at the end of "gate" in array A. c) error produced by compiler d) none of these
Consider the following C code:char A[20]; A="gate";Which of the following is correct?a) '\0' is automatically appended at the end of "gate".b) '\0' is not stored at the e...
422
views
answered
Dec 11, 2014
Programming in C
programming-in-c
+
–
0
votes
7
what is the output of foo(10)?
int foo(unsigned int n) { int c,x=0; while(n!=0) { if(n&01) x++; n>>=1; } return c; }
int foo(unsigned int n) { int c,x=0; while(n!=0) { if(n&01) x++; n>>=1; } return c; }
1.4k
views
answered
Dec 11, 2014
Programming in C
programming
recursion
+
–
7
votes
8
GATE CSE 2004 | Question: 33
Consider the following C program segment: char p[20]; int i; char* s = "string"; int length = strlen(s); for(i = 0; i < length; i++) p[i] = s[length-i]; printf("%s", p); The output of the program is: gnirts string gnirt no output is printed
Consider the following C program segment:char p[20]; int i; char* s = "string"; int length = strlen(s); for(i = 0; i < length; i++) p[i] = s[length-i]; printf("%s", p);Th...
13.1k
views
answered
Nov 25, 2014
Programming in C
gatecse-2004
programming
programming-in-c
easy
+
–
3
votes
9
GATE IT 2006 | Question: 49
Which one of the choices given below would be printed when the following program is executed ? #include <stdio.h> struct test { int i; char *c; }st[] = {5, "become", 4, "better", 6, "jungle", 8, "ancestor", 7, " ... $\text{etter, u, 6, ungle}$ $\text{cetter, k, 6, jungle}$ $\text{etter, u, 8, ncestor}$
Which one of the choices given below would be printed when the following program is executed ?#include <stdio.h struct test { int i; char *c; }st[] = {5, "become", 4, "be...
27.3k
views
answered
Nov 25, 2014
Programming in C
gateit-2006
programming
programming-in-c
normal
structure
+
–
3
votes
10
GATE IT 2006 | Question: 50
Which one of the choices given below would be printed when the following program is executed? #include <stdio.h> void swap (int *x, int *y) { static int *temp; temp = x; x = y; y = temp; } void printab () { static int i, a = -3, b = -6; i = 0; while (i <= 4) { if ((i++)%2 == 1 ... $a = 12, b = 9$ $a = 3, b = 6$ $a = 3, b = 6$ $a = 6, b = 3$ $a = 15, b = 12$
Which one of the choices given below would be printed when the following program is executed?#include <stdio.h void swap (int *x, int *y) { static int *temp; temp = x; x ...
25.8k
views
answered
Nov 21, 2014
Programming in C
gateit-2006
programming
programming-in-c
normal
parameter-passing
+
–
5
votes
11
GATE IT 2006 | Question: 51
Which one of the choices given below would be printed when the following program is executed? #include <stdio.h> int a1[] = {6, 7, 8, 18, 34, 67}; int a2[] = {23, 56, 28, 29}; int a3[] = {-12, 27, -31}; int *x[] = {a1, a2, a3}; void print(int *a[]) { printf("%d," ... (x); } $8, -12, 7, 23, 8$ $8, 8, 7, 23, 7$ $-12, -12, 27, -31, 23$ $-12, -12, 27, -31, 56$
Which one of the choices given below would be printed when the following program is executed? #include <stdio.h int a1[] = {6, 7, 8, 18, 34, 67}; int a2[] = {23, 5...
13.1k
views
answered
Nov 20, 2014
Programming in C
gateit-2006
programming
programming-in-c
normal
+
–
9
votes
12
GATE CSE 2004 | Question: 90
Choose the best matching between the programming styles in Group 1 and their characteristics in Group 2. ... $P-3\quad Q-4 \quad R-1\quad S-2$ $P-3\quad Q-4\quad R-2\quad S-1$
Choose the best matching between the programming styles in Group 1 and their characteristics in Group 2.$$\begin{array}{|ll|ll|}\hline \rlap{\textbf{Group 1}} & & \rlap{...
7.1k
views
answered
Nov 18, 2014
Programming in C
gatecse-2004
programming
normal
programming-paradigms
match-the-following
+
–
45
votes
13
GATE CSE 1998 | Question: 2.15
Faster access to non-local variables is achieved using an array of pointers to activation records called a stack heap display activation tree
Faster access to non-local variables is achieved using an array of pointers to activation records called a stackheapdisplayactivation tree
8.9k
views
answered
Nov 17, 2014
Compiler Design
gate1998
programming
compiler-design
normal
runtime-environment
+
–
15
votes
14
GATE IT 2004 | Question: 60
Choose the correct option to fill the $?1$ and $?2$ so that the program prints an input string in reverse order. Assume that the input string is terminated by a new line character. #include <stdio.h> void wrt_it (void); int main (void) { printf("Enter Text"); ... $putchar(c);$ $?1$ is $(c = getchar()) ! =$ '\n' $?2$ is $putchar(c);$
Choose the correct option to fill the $?1$ and $?2$ so that the program prints an input string in reverse order. Assume that the input string is terminated by a new line ...
5.9k
views
answered
Nov 16, 2014
Programming in C
gateit-2004
programming
programming-in-c
normal
+
–
5
votes
15
GATE IT 2004 | Question: 61
Consider the following C program: #include <stdio.h> typedef struct { char *a; char *b; } t; void f1 (t s); void f2 (t *p); main() { static t s = {"A", "B"}; printf ("%s %s\n", s.a, s.b); f1(s); printf ("%s %s\n", s.a, s.b); f2(&s); } void ... $A \ B$ $V \ W$ $A \ B$ $U \ V$ $U \ V$ $V \ W$ $A \ B$ $U \ V$ $V \ W$ $U \ V$
Consider the following C program:#include <stdio.h typedef struct { char *a; char *b; } t; void f1 (t s); void f2 (t *p); main() { static t s = {"A", "B"}; printf ("%s %s...
10.1k
views
answered
Nov 16, 2014
Programming in C
gateit-2004
programming
programming-in-c
normal
structure
+
–
0
votes
16
GATE IT 2004 | Question: 15
Let $x$ be an integer which can take a value of $0$ or $1$. The statement if (x == 0) x = 1; else x = 0; is equivalent to which one of the following ? $x = 1 + x;$ $x = 1 - x;$ $x = x - 1;$ $x = 1\% x;$
Let $x$ be an integer which can take a value of $0$ or $1$. The statementif (x == 0) x = 1; else x = 0;is equivalent to which one of the following ?$x = 1 + x;$$x = 1 - ...
9.9k
views
answered
Nov 14, 2014
Programming in C
gateit-2004
programming
easy
identify-function
+
–
30
votes
17
GATE IT 2007 | Question: 34, UGCNET-Dec2012-III: 52
Consider the program below in a hypothetical programming language which allows global variables and a choice of static or dynamic scoping. int i; program main() { i = 10; call f(); } procedure f() { int i = 20; call g (); } procedure g() { print i; } Let $x$ be the ... . Then, $x$ and $y$ are: $x=10, y=20$ $x=20, y=10$ $x=10, y=10$ $x=20, y=20$
Consider the program below in a hypothetical programming language which allows global variables and a choice of static or dynamic scoping.int i; program main() { i = 10; ...
7.6k
views
answered
Nov 14, 2014
Programming in C
gateit-2007
programming
variable-binding
easy
ugcnetcse-dec2012-paper3
+
–
28
votes
18
GATE IT 2005 | Question: 54
The following C function takes a singly-linked list of integers as a parameter and rearranges the elements of the list. The list is represented as pointer to a structure. The function is called with the list containing the integers $1, 2, 3, 4, 5, 6, 7$ in the given order. What will be the contents of ... $1, 3, 2, 5, 4, 7, 6$ $2, 3, 4, 5, 6, 7, 1$
The following C function takes a singly-linked list of integers as a parameter and rearranges the elements of the list. The list is represented as pointer to a structure....
8.1k
views
answered
Nov 14, 2014
DS
gateit-2005
data-structures
linked-list
normal
+
–
39
votes
19
GATE CSE 2004 | Question: 31, ISRO2008-40
Consider the following C function: int f(int n) { static int i = 1; if(n >= 5) return n; n = n+i; i++; return f(n); } The value returned by $f(1)$ is: $5$ $6$ $7$ $8$
Consider the following C function:int f(int n) { static int i = 1; if(n >= 5) return n; n = n+i; i++; return f(n); }The value returned by $f(1)$ is:$5$$6$$7$$8$
14.7k
views
answered
Nov 12, 2014
Programming in C
gatecse-2004
programming
programming-in-c
recursion
easy
isro2008
+
–
0
votes
20
if-else condition based question
What's the "condition" so that the following code snippet prints both HelloWorld ! if "condition" printf ("Hello"); else printf ("World");
What's the "condition" so that the following code snippet prints both HelloWorld ! if "condition" printf ("Hello"); else printf ("World");
961
views
answered
Nov 10, 2014
Programming in C
programming-in-c
+
–
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register