Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage
Programming in C.
Recursion.
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Hot questions in Programming and DS
0
votes
0
answers
2701
C programming
Consider a part of program: int i=4,t; t=i++ + i++ + i++; printf("%d",t); Why the value of t comes out to be 15(in codeblocks)? Since we have post increment so first value of i must be used Therefore ans must be 12. Secondly, int i=4,t; t=++i + i++ + i++; printf("%d",t); Its output must be 5+5+5=15 but it comes out to be 17 Why?
Consider a part of program:int i=4,t; t=i++ + i++ + i++; printf("%d",t);Why the value of t comes out to be 15(in codeblocks)?Since we have post increment so first value ...
akshay139
170
views
akshay139
asked
May 2, 2018
1
votes
2
answers
2702
GATE Overflow | Data Structures | Test 1 | Question: 25
Consider the following nested representation of Binary Trees. $(ABC)$ indicates $B$ and $C$ are left and right subtrees of node $A$ respectively. Note that $B$ and $C$ may be NULL or further nested. Which of the following representation is not a valid Binary tree? (1 2 3) (1 (2 3 4) (5 6 7)) (1 (1 (1 1 1) (1 1 1)) (1 1 1)) (1 (2 3) 4)
Consider the following nested representation of Binary Trees.$(ABC)$ indicates $B$ and $C$ are left and right subtrees of node $A$ respectively. Note that $B$ and $C$ may...
Arjun
496
views
Arjun
asked
Oct 10, 2016
DS
go-ds-1
data-structures
binary-tree
+
–
0
votes
0
answers
2703
ISI 2016 PCB C5
What will be the output of the following C program? If you think it will give a runtime error, you need to mention it. In either case, your answer must include proper justi cations without which no credit will be given. #include<stdio.h> main() { unsigned char i, j, a[] = {1, 2, 3, 4, 5} ... j, n); while(j-- != 0) a[0] += n; printf("j = %d, a[0] = %d\n", j, a[0]); }
What will be the output of the following C program? If you think it will give a runtime error, you need to mention it. In either case, your answer must include proper jus...
Gawade Sahadev
277
views
Gawade Sahadev
asked
Apr 27, 2018
Programming in C
programming-in-c
+
–
1
votes
1
answer
2704
max heap with binary search
Parshu gate
1.4k
views
Parshu gate
asked
Jan 3, 2018
0
votes
1
answer
2705
Hashing
Can someone explain Secondary Clustering to me? The distance between two successive probes is quadratic. I get it, but how are clusters being formed?
Can someone explain Secondary Clustering to me? The distance between two successive probes is quadratic. I get it, but how are clusters being formed?
Parimal Paritosh
810
views
Parimal Paritosh
asked
Mar 8, 2018
Programming in C
hashing
uniform-hashing
algorithms
+
–
1
votes
2
answers
2706
ME test series
Consider the following program segment int main() { char *str = "GATECS"; printf("%d",madeeasy(str)); return 0; } int madeeasy(int *p1) { int *p2=p1; while(*++p1); return(p1-p2); } The output of the above program will be _____ . Assume that the object of data type $int$ occupies $2$ bytes.
Consider the following program segmentint main() { char *str = "GATECS"; printf("%d",madeeasy(str)); return 0; } int madeeasy(int *p1) { int *p2=p1; while(*++p1); return(...
himgta
1.2k
views
himgta
asked
Mar 10, 2018
Programming in C
programming-in-c
+
–
2
votes
2
answers
2707
bitwise shift operator
Please tell the output ! With explanation.. #include<stdio.h> int main() { printf("%d", 2<<2>>2); printf("\n%d", 2>>2<<2<<(1<<1)); return 0; }
Please tell the output ! With explanation..#include<stdio.h>int main(){ printf("%d", 2<<2>>2); printf("\n%d", 2>>2<<2<<(1<<1)); return 0;}
Sanyam Lakhanpal
4.1k
views
Sanyam Lakhanpal
asked
Jul 18, 2017
0
votes
2
answers
2708
Program Output
What will be the output: #include <iostream> using namespace std; int main() { char *A[] = { "abcx", "dbba", "cccc"}; char var = *(A+1) - *A+1; cout << (*A + var); } 1. $abba$ 2. $bba$ 3. $a$ d. none
What will be the output: #include <iostream using namespace std; int main() { char *A[] = { "abcx", "dbba", "cccc"}; char var = *(A+1) - *A+1; cout << (*A + var); }1. $ab...
gate_forum
1.2k
views
gate_forum
asked
Feb 2, 2018
Programming in C
programming
+
–
0
votes
1
answer
2709
C Programming
#include<stdio.h> typedef int ARRAY[10][10]; int main() { ARRAY arr[2]; printf("Size is %d",sizeof(arr)); } The program on running produces output Size is $800$ I know typedef is used for providing alternate names to existing datatypes. Can someone explain what's happening? Or correct me
#include<stdio.h typedef int ARRAY[10][10]; int main() { ARRAY arr ; printf("Size is %d",sizeof(arr)); } The program on running produces output Size is $800$I know typede...
gauravkc
305
views
gauravkc
asked
Mar 26, 2018
Programming in C
programming-in-c
output
programming
+
–
0
votes
1
answer
2710
Test by Bikram | Data Structures | Test 2 | Question: 17
Two adjacent edges in a simple graph are said to be in series if their common vertex is of degree ____. 1 2 3 4
Two adjacent edges in a simple graph are said to be in series if their common vertex is of degree ____.1234
Bikram
350
views
Bikram
asked
Nov 26, 2016
DS
tbb-ds-2
graph-connectivity
+
–
0
votes
2
answers
2711
UGC NET CSE | June 2009 | Part 2 | Question: 27
In a full binary tree of height k, there are ______ internal nodes . 2k-1 2k-1 2k 2k+1
In a full binary tree of height k, there are ______ internal nodes .2k-1 2k-1 2k 2k+1
rishu_darkshadow
3.8k
views
rishu_darkshadow
asked
Sep 22, 2017
DS
ugcnetcse-june2009-paper2
data-structures
binary-tree
+
–
2
votes
3
answers
2712
mock test
Consider n elements that are equally distributed in k stacks. In each stack, elements of it are arranged in ascending order (min is at the top in each of the stack and then increasing downwards). Given a queue of size n in which we have to put all n elements in increasing order. What will be the time complexity of the best known algorithm?
Consider n elements that are equally distributed in k stacks. In each stack, elements of it are arranged in ascending order (min is at the top in each of the stack and th...
chandra sai
2.9k
views
chandra sai
asked
Nov 4, 2017
DS
stack
algorithms
data-structures
+
–
1
votes
1
answer
2713
Gate-2011
Pointer to Strings Please clear this concept check this program #include<stdio.h> #include<string.h> int main () { char *ptr = "Gateoverflow"; printf ("String = %s", ptr); //1 printf ("\tAddress of string literal = %u\ ... of string literal = $4195892$ Doubt : Why first print statement does not print the addresses of first character of the string ?
Pointer to StringsPlease clear this concept check this program #include<stdio.h #include<string.h int main () { char *ptr = "Gateoverflow"; printf ("String = %s", ptr); /...
hsmart
694
views
hsmart
asked
Mar 20, 2018
Programming in C
programming-in-c
+
–
0
votes
0
answers
2714
suggestion
can anyone help me how to prepare the c programming language for gate?
can anyone help me how to prepare the c programming language for gate?
priyam saha
235
views
priyam saha
asked
Apr 27, 2018
0
votes
1
answer
2715
Passing array as function argument
#include<stdio.h> void temp(int a[]); main(){ int a[5]={1,2,3,4,5}; printf("%d", sizeof(a)); temp(a); } void temp(int a[]){ printf(" %d", sizeof(a)); } Output of above code is, given size of int is 4 byte $20$ $20$ $20$ $8$ $8$ $8$ $8$ $20$
#include<stdio.h void temp(int a[]); main(){ int a[5]={1,2,3,4,5}; printf("%d", sizeof(a)); temp(a); } void temp(int a[]){ printf(" %d", sizeof(a)); }Output of above code...
hacker16
546
views
hacker16
asked
Apr 5, 2018
Programming in C
programming-in-c
+
–
3
votes
1
answer
2716
Programming
#include<stdio.h> int main() { char arr[5][7][6]; char *p[5][7][6]; printf("%d\t", (unsigned)(arr+1)-(unsigned)arr); printf("%d", (unsigned)(p+1)-(unsigned)p); } Please enlighten about the 2nd printf statement. Also what is the difference between the two statements?
#include<stdio.h int main() { char arr[5][7][6]; char *p[5][7][6]; printf("%d\t", (unsigned)(arr+1)-(unsigned)arr); printf("%d", (unsigned)(p+1)-(unsigned)p); }Please enl...
just_bhavana
1.5k
views
just_bhavana
asked
Jan 18, 2018
Programming in C
non-gate
+
–
20
votes
1
answer
2717
GATE CSE 2005 | Question: 34
A priority queue is implemented as a Max-Heap. Initially, it has $5$ elements. The level-order traversal of the heap is: $10, 8, 5, 3, 2$. Two new elements $1$ and $7$ ... $10, 8, 7, 2, 3, 1, 5$ $10, 8, 7, 1, 2, 3, 5$ $10, 8, 7, 3, 2, 1, 5$
A priority queue is implemented as a Max-Heap. Initially, it has $5$ elements. The level-order traversal of the heap is: $10, 8, 5, 3, 2$. Two new elements $1$ and $7$ ar...
Kathleen
14.0k
views
Kathleen
asked
Sep 22, 2014
DS
gatecse-2005
data-structures
binary-heap
normal
+
–
1
votes
2
answers
2718
Practice Question
#include<stdio.h> int main(void) { int p = 1; int q = 0; q = p++ + p++; printf("%d %d",p,q); return 0; } Output is Showing $3,3$ How ?
#include<stdio.h int main(void) { int p = 1; int q = 0; q = p++ + p++; printf("%d %d",p,q); return 0; }Output is Showing $3,3$ How ?
Nikhil Patil
1.2k
views
Nikhil Patil
asked
Feb 10, 2018
Programming in C
programming-in-c
+
–
1
votes
1
answer
2719
self doubt
#include<stdio.h> main() { char *p = 0; *p = 'a'; printf("value in pointer p is %c\n",*p); } What is the output of this code ? Why?
#include<stdio.h main() { char *p = 0; *p = 'a'; printf("value in pointer p is %c\n",*p); }What is the output of this code ? Why?
Raj Kumar 7
391
views
Raj Kumar 7
asked
Mar 30, 2018
Programming in C
programming-in-c
+
–
1
votes
1
answer
2720
#Test series
what is the output?
what is the output?
himgta
332
views
himgta
asked
Apr 13, 2018
Page:
« prev
1
...
131
132
133
134
135
136
137
138
139
140
141
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register