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
Recent questions in Programming in C
0
votes
1
answer
101
A possible output of the following program Fragment
A possible output of the following program fragment #include <stdio.h> int main(void) { static char were[ ] [5]={"harmot","merli","axari"}; printf("%d %d %d",were,were[0],&were[0][0]); return 0; } is A) 262164 262164 262164 B) 262164 262165 262166 C) 262164 262164 262165
A possible output of the following program fragment#include <stdio.h int main(void) { static char were[ ] [5]={"harmot","merli","axari"}; printf("%d %d %d",were,were[0],&...
neha singh
1.7k
views
neha singh
asked
Mar 6, 2017
0
votes
1
answer
102
int hh=16; static char{}="NO SUBSTITUTE FOR HARD WORK";
static char{}="NO SUBSTITUTE FOR HARD WORK"; Printf("%10.5s", wer); Outputs a) NO SU B) NO SUBSTIT C) UTE F
static char{}="NO SUBSTITUTE FOR HARD WORK";Printf("%10.5s", wer);Outputsa) NO SUB) NO SUBSTITC) UTE F
neha singh
1.8k
views
neha singh
asked
Mar 5, 2017
0
votes
1
answer
103
If y is of integer type then the below expressions 3*(y-8) / 9 and (y-8) / 9*3
If y is of integer type then the below expression 3*(y-8) / 9 and (y-8) / 9*3 a) must yield different value B)Must yield same value c) may or may not yield same value D) none of the above
If y is of integer type then the below expression 3*(y-8) / 9 and (y-8) / 9*3 a) must yield different valueB)Must yield same valuec) may or may not yield same valueD) non...
neha singh
4.3k
views
neha singh
asked
Mar 5, 2017
1
votes
1
answer
104
ISRO 2008- ECE GOTO statement
The "go to statement" causes control to go to (a) An operator (b) A label (c) A variable (d) A function
The "go to statement" causes control to go to(a) An operator(b) A label(c) A variable(d) A function
sh!va
1.7k
views
sh!va
asked
Mar 2, 2017
Programming in C
isro-ece
+
–
0
votes
2
answers
105
ISRO 2008-ECE exit() function
The library function exit ( ) causes as exit from (a) the loop in which it occurs (b) the block is which it occurs (c) the functions in which it occurs (d) the progam in which it occurs
The library function exit ( ) causes as exit from (a) the loop in which it occurs(b) the block is which it occurs(c) the functions in which it occurs(d) the progam in whi...
sh!va
1.5k
views
sh!va
asked
Mar 2, 2017
Programming in C
isro-ece
programming
+
–
0
votes
1
answer
106
ISRO 2008-ECE programming
A program having features such as data abstraction, encapsulation and data hiding, polymorphism inheritance is called (a) Structured program (b) Object oriented program (c) Open source program (d) Real time program
A program having features such as data abstraction, encapsulation and data hiding, polymorphism inheritance is called(a) Structured program(b) Object oriented program(c) ...
sh!va
375
views
sh!va
asked
Mar 2, 2017
Programming in C
isro-ece
programming
object-oriented-programming
+
–
0
votes
1
answer
107
pseudo code result
Sanjay Sharma
326
views
Sanjay Sharma
asked
Mar 1, 2017
0
votes
1
answer
108
pesudo-code output
Sanjay Sharma
274
views
Sanjay Sharma
asked
Mar 1, 2017
0
votes
0
answers
109
most powerful language paradigm
Sanjay Sharma
255
views
Sanjay Sharma
asked
Mar 1, 2017
0
votes
2
answers
110
output of program
If the following fragment (assume negative numbers are stored in 2's complement form) unsigned i=1; int j=-4; printf("%u",i+j); prints x then printf("%d", 8*sizeof(int)); outputs an integer that is same as (log in the options are of base 2) a)8*log(x+3) b)log(x+3) c)unpredictable value d)none of the above
If the following fragment (assume negative numbers are stored in 2's complement form)unsigned i=1;int j=-4;printf("%u",i+j);prints x then printf("%d", 8*sizeof(int));outp...
Sanjay Sharma
983
views
Sanjay Sharma
asked
Feb 27, 2017
0
votes
0
answers
111
segmentation fault or compilation error ?
Consider this C code to swap two integers and these five statements : void swap (int * px, int * py) { * px = *px - *py ; *py = *px + *py; *px = *py - *px; } S1 : Will generate a compilation error S2 : May generate a segmentation fault ... input pointers. S5 : May add or subtract integers and pointers. (A) S1 (B) S2 and S3 (C) S2 and S4 (D) S2 and S5
Consider this C code to swap two integers and these five statements :void swap (int * px, int * py){ * px = *px – *py ; *py = *px + *py; *...
Sanjay Sharma
1.0k
views
Sanjay Sharma
asked
Feb 24, 2017
2
votes
1
answer
112
C programming
int a[20]; unsigned int m; // global variable int foo(int a[]) { int i=0,count = 0; while(i < 20) m |= 1<<(a[i++]-1); i = (sizeof(int)<<3)-1; while(i>=0) if(m&(1<<(i--))) count++; return count; } In the above ... elements in a[] which are more than $20$ B No of distinct elements in a[] which less than $20$ C No of distinct elements in a[] D None of these
int a[20]; unsigned int m; // global variable int foo(int a[]) { int i=0,count = 0; while(i < 20) m |= 1<<(a[i++]-1); i = (sizeof(int)<<3)-1; while(i>=0) if(m&(1<<(i ))) ...
dd
568
views
dd
asked
Feb 18, 2017
Programming in C
programming-in-c
output
+
–
2
votes
2
answers
113
let x be an array of integer which of the following can not be present in the LHS of an assignment statement
let x be an array of integer . which of the following can not be present in the left hand side of an assignment statementa)x b) x+i c) * (x+i) d) &x[i]
Sanjay Sharma
2.7k
views
Sanjay Sharma
asked
Feb 18, 2017
2
votes
3
answers
114
program output
main() { static char a[3][4] = { "abcd", "efgh", "ijkl"}; putchar(**a); } a) compilation error b) run time error c)garbage d) none of these
main() {static char a[3][4] = { "abcd", "efgh", "ijkl"};putchar( a); } a) compilation error b) run time errorc)garbage d) none of these
Sanjay Sharma
1.5k
views
Sanjay Sharma
asked
Feb 18, 2017
0
votes
2
answers
115
difference between if(a=0) and if(a=non zero)
what is the differernce between if (a=0) and if (a= -7) or any other non-zero number e.g what will be the out put of following program a)if ( a=0) printf(""a is zero ") else printf("a is not zero") and if we replace 0 by some +ve or -ve number then
what is the differernce between if (a=0) and if (a= -7) or any other non-zero number e.g what will be the out put of following program a)if ( a=0)printf(""a is zero ")els...
Sanjay Sharma
2.2k
views
Sanjay Sharma
asked
Feb 17, 2017
3
votes
1
answer
116
Let x be an array . which of the following operations are illegal
Let x be an array . which of the following operations are illegal and why a) ++x b) x+1 c) x++ d) x - -
Let x be an array . which of the following operations are illegal and whya) ++x b) x+1 c) x++ d) x - -
Sanjay Sharma
6.6k
views
Sanjay Sharma
asked
Feb 17, 2017
0
votes
2
answers
117
2017_1_42
#include <stdio.h> int total(int v) { static int count=0; while(v){ count+=v&1; v>>=1; } return count; } void main() { // your code goes here static int x=0; int i=5; for(;i>0;i--) { x=x+total(i); } printf("%d\n",x); return 0; }
#include <stdio.h int total(int v) { static int count=0; while(v){ count+=v&1; v>>=1; } return count; } void main() { // your code goes here static int x=0; int i=5; for(...
harveen singh
840
views
harveen singh
asked
Feb 14, 2017
102
votes
9
answers
118
GATE CSE 2017 Set 1 | Question: 53
Consider the following C program. #include<stdio.h> #include<string.h> void printlength(char *s, char *t) { unsigned int c=0; int len = ((strlen(s) - strlen(t)) > c) ? strlen(s) : strlen(t); printf("%d\n", len); } ... in $string.h$ as returning a value of type $size\_t$, which is an unsigned int. The output of the program is __________ .
Consider the following C program.#include<stdio.h #include<string.h void printlength(char *s, char *t) { unsigned int c=0; int len = ((strlen(s) - strlen(t)) c) ? strlen...
srestha
25.4k
views
srestha
asked
Feb 14, 2017
Programming in C
gatecse-2017-set1
programming
programming-in-c
normal
numerical-answers
+
–
68
votes
5
answers
119
GATE CSE 2017 Set 1 | Question: 55
The output of executing the following C program is _______________ . #include<stdio.h> int total(int v) { static int count = 0; while(v) { count += v&1; v >>= 1; } return count; } void main() { static int x=0; int i=5; for(; i>0; i--) { x = x + total(i); } printf("%d\n", x); }
The output of executing the following C program is _______________ .#include<stdio.h int total(int v) { static int count = 0; while(v) { count += v&1; v >>= 1; } return c...
srestha
22.8k
views
srestha
asked
Feb 14, 2017
Programming in C
gatecse-2017-set1
programming
programming-in-c
normal
numerical-answers
+
–
54
votes
7
answers
120
GATE CSE 2017 Set 2 | Question: 43
Consider the following snippet of a C program. Assume that swap $(\&x, \&y)$ exchanges the content of $x$ and $y$: int main () { int array[] = {3, 5, 1, 4, 6, 2}; int done =0; int i; while (done==0) { done =1; for (i=0; i<=4; i ... i-1]) { swap(&array[i], &array[i-1]); done =0; } } } printf( %d , array[3]); } The output of the program is _______
Consider the following snippet of a C program. Assume that swap $(\&x, \&y)$ exchanges the content of $x$ and $y$:int main () { int array[] = {3, 5, 1, 4, 6, 2}; int done...
Arjun
17.3k
views
Arjun
asked
Feb 14, 2017
Programming in C
gatecse-2017-set2
programming
algorithms
numerical-answers
identify-function
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
10
11
...
206
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register