Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Search results for programming-in-c
12
votes
3
answers
41
GATE CSE 2022 | Question: 11
What is printed by the following $\text{ANSI C}$ program? #include<stdio.h> int main(int argc, char *argv[]) { int x = 1, z[2] = {10, 11}; int *p = NULL; p = &x; *p = 10; p = &z[1]; *(&z[0] + 1) += 3; printf(“%d, %d, %d\n”, x, z[0], z[1]); return 0; } $1, 10, 11$ $1, 10, 14$ $10, 14, 11$ $10, 10, 14$
What is printed by the following $\text{ANSI C}$ program?#include<stdio.h int main(int argc, char *argv[]) { int x = 1, z = {10, 11}; int *p = NULL; p = &x; *p = 10; p =...
Arjun
5.7k
views
Arjun
asked
Feb 15, 2022
Programming in C
gatecse-2022
programming
programming-in-c
pointers
output
1-mark
+
–
3
votes
2
answers
42
GATE CSE 2024 | Set 2 | Question: 3
Consider the following $\text{C}$ program. Assume parameters to a function are evaluated from right to left. #include <stdio.h> int g( int p) { printf("%d", p); return p; } int h(i nt q) { printf("%d", q) ... one of the following options is the CORRECT output of the above $\text{C}$ program? $20101020$ $10202010$ $20102010$ $10201020$
Consider the following $\text{C}$ program. Assume parameters to a function are evaluated from right to left.#include <stdio.h>int g( int p) { printf("%d", p); return p; }...
Arjun
3.3k
views
Arjun
asked
Feb 16
Programming in C
gatecse2024-set2
programming
programming-in-c
+
–
26
votes
3
answers
43
GATE CSE 2008 | Question: 18
Which combination of the integer variables $x, y,$ and $z$ makes the variable $a$ get the value $4$ in the following expression? $a=(x > y)?((x > z) ?x:z): ((y > z) ?y:z)$ $x=3, y=4, z=2$ $x=6, y=5, z=3$ $x=6, y=3, z=5$ $x=5, y=4, z=5$
Which combination of the integer variables $x, y,$ and $z$ makes the variable $a$ get the value $4$ in the following expression?$$a=(x y)?((x z) ?x:z): ((y z) ?y:z)$$$...
Kathleen
12.4k
views
Kathleen
asked
Sep 11, 2014
Programming in C
gatecse-2008
programming
programming-in-c
easy
+
–
1
votes
3
answers
44
GATE CSE 2024 | Set 1 | Question: 9
Consider the following $\mathrm{C}$ program: #include <stdio.h> void fX () { void fX () ; char a; int main() { if ((a=g e t c h a r()) ! = '\n') fX}() ; fX(); return 0 ; if (a ! ... program will not terminate The program will terminate with no output The program will terminate with $4321$ as output The program will terminate with $1234$ as output
Consider the following $\mathrm{C}$ program:#include <stdio.h void fX () {void fX () ; char a;int main() { if ((a=g e t c h a r()) ! = '\n')fX}() ; fX();return 0 ; if ...
Arjun
2.7k
views
Arjun
asked
Feb 16
Programming in C
gatecse2024-set1
programming
programming-in-c
+
–
100
votes
6
answers
45
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...
Ishrat Jahan
26.9k
views
Ishrat Jahan
asked
Oct 31, 2014
Programming in C
gateit-2006
programming
programming-in-c
normal
structure
+
–
0
votes
1
answer
46
Which of the following is not a member of a class ?
A. Static function B. Friend Function C. Const Function D. Virtual function
A. Static functionB. Friend FunctionC. Const FunctionD. Virtual function
im.raj
56.5k
views
im.raj
asked
May 6, 2016
Programming in C
programming-in-c
programming
+
–
3
votes
1
answer
47
GATE CSE 2024 | Set 2 | Question: 23
Consider the following $\mathrm{C}$ function definition. int f X(char * a) { char * b = a; while (*b) b ++; return b - a; } Which of the following statements is/are TRUE? The function call $\text{f X("a b c d''}$) will ... ${ }^{*} \mathrm{C}=$ "abcd" in main (), the function call $\mathrm{fX}(\mathrm{c})$ will always return a value
Consider the following $\mathrm{C}$ function definition.int f X(char * a) {char * b = a;while (*b)b ++;return b - a; }Which of the following statements is/are T...
Arjun
2.1k
views
Arjun
asked
Feb 16
Programming in C
gatecse2024-set2
programming
programming-in-c
multiple-selects
+
–
29
votes
7
answers
48
GATE CSE 2016 Set 2 | Question: 12
The value printed by the following program is _______. void f (int * p, int m) { m = m + 5; *p = *p + m; return; } void main () { int i=5, j=10; f (&i, j); printf ("%d", i+j); }
The value printed by the following program is _______.void f (int * p, int m) { m = m + 5; *p = *p + m; return; } void main () { int i=5, j=10; f (&i, j); p...
Akash Kanase
8.8k
views
Akash Kanase
asked
Feb 12, 2016
Programming in C
gatecse-2016-set2
programming-in-c
normal
numerical-answers
parameter-passing
+
–
2
votes
2
answers
49
GATE CSE 2024 | Set 2 | Question: 26
What is the output of the following $\text{C}$ program? #include <stdio.h> int main() { double $a[2]=\{20.0,25.0\},{ }^{*} \mathrm{p},{ }^{*} \mathrm{q}$; $\mathrm{p}=\mathrm{a} ;$ $q=p+1 ;$ printf("%d,%d", (int) $(q-p),($ int $\left.)\left({ }^{*} q-{ }^{*} p\right)\right)$; return $0$ ; } $4,8$ $1,5$ $8,5$ $1,8$
What is the output of the following $\text{C}$ program?#include <stdio.h>int main() {double $a =\{20.0,25.0\},{ }^{*} \mathrm{p},{ }^{*} \mathrm{q}$;$\mat...
Arjun
2.5k
views
Arjun
asked
Feb 16
Programming in C
gatecse2024-set2
programming
programming-in-c
+
–
62
votes
5
answers
50
GATE CSE 2014 Set 1 | Question: 10
Consider the following program in C language: #include <stdio.h> main() { int i; int*pi = &i; scanf("%d",pi); printf("%d\n", i+5); } Which one of the following statements is TRUE? Compilation fails. Execution ... $5$ more than the address of variable $i$. On execution, the value printed is $5$ more than the integer value entered.
Consider the following program in C language:#include <stdio.h main() { int i; int*pi = &i; scanf("%d",pi); printf("%d\n", i+5); }Which one of the following statements is...
go_editor
17.3k
views
go_editor
asked
Sep 26, 2014
Programming in C
gatecse-2014-set1
programming
programming-in-c
easy
pointers
+
–
3
votes
2
answers
51
GATE CSE 2024 | Set 2 | Question: 32
Consider an array $\mathrm{X}$ that contains $\mathrm{n}$ positive integers. A subarray of $\mathrm{X}$ is defined to be a sequence of array locations with consecutive indices. The $\mathrm{C}$ code snippet given below has been written to compute the length of the longest ... $\text{(P) } \text{len} 2+1$ $\text{(Q) } \text{len} 1+1$
Consider an array $\mathrm{X}$ that contains $\mathrm{n}$ positive integers. A subarray of $\mathrm{X}$ is defined to be a sequence of array locations with co...
Arjun
1.7k
views
Arjun
asked
Feb 16
Programming in C
gatecse2024-set2
programming
programming-in-c
+
–
45
votes
4
answers
52
GATE CSE 2012 | Question: 48
Consider the following C code segment. int a, b, c = 0; void prtFun(void); main() { static int a = 1; /* Line 1 */ prtFun(); a += 1; prtFun(); printf( \n %d %d , a, b); } void prtFun(void) { static int a = 2; /* Line 2 */ int b = 1; a += + ... $\begin{array}{lll} 3 & & 1 & \\ 5 & & 2 & \\ 5 & & 2 & \end{array}$
Consider the following C code segment.int a, b, c = 0; void prtFun(void); main() { static int a = 1; /* Line 1 */ prtFun(); a += 1; prtFun(); printf(“ \n %d %d ”, a, ...
gatecse
13.7k
views
gatecse
asked
Sep 29, 2014
Programming in C
gatecse-2012
programming
programming-in-c
normal
+
–
40
votes
5
answers
53
GATE CSE 2012 | Question: 3
What will be the output of the following C program segment? char inChar = 'A'; switch ( inChar ) { case 'A' : printf ("Choice A \ n"); case 'B' : case 'C' : printf ("Choice B"); case ... : printf ("No Choice"); } No Choice Choice A Choice A Choice B No Choice Program gives no output as it is erroneous
What will be the output of the following C program segment?char inChar = 'A'; switch ( inChar ) { case 'A' : printf ("Choice A \ n"); case 'B' : case 'C' : printf ("Choic...
gatecse
10.8k
views
gatecse
asked
Aug 5, 2014
Programming in C
gatecse-2012
programming
easy
programming-in-c
switch-case
+
–
23
votes
4
answers
54
GATE IT 2008 | Question: 50
Consider the C program below. What does it print? # include <stdio.h> # define swapl (a, b) tmp = a; a = b; b = tmp void swap2 ( int a, int b) { int tmp; tmp = a; a = b; b = tmp; } void swap3 (int*a, int*b) { int tmp; tmp = *a; *a = *b; *b ... (num1 > = num2) {swap3 (&num1, &num2);} printf ("%d, %d", num1, num2); } $5, 5$ $5, 4$ $4, 5$ $4, 4$
Consider the C program below. What does it print?# include <stdio.h # define swapl (a, b) tmp = a; a = b; b = tmp void swap2 ( int a, int b) { int tmp; tmp = a; a = b; b ...
Ishrat Jahan
10.4k
views
Ishrat Jahan
asked
Oct 28, 2014
Programming in C
gateit-2008
programming
programming-in-c
easy
parameter-passing
+
–
7
votes
2
answers
55
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 33
On a $64$-bit system, which of the following C expressions is equivalent to the C expression $(x[2]+4)[3]?$ Assume $\mathrm{x}$ is declared as $\textsf{int}\ast \ast \textsf{x}$ $\ast((*(x+16))+28)$ $\ast((*(x+2))+7)$ $\ast(((* x)+2)+7)$ $(* \ast(x+2)+7)$
On a $64$-bit system, which of the following C expressions is equivalent to the C expression $(x +4)[3]?$ Assume $\mathrm{x}$ is declared as $\textsf{int}\ast \ast \text...
GO Classes
420
views
GO Classes
asked
Feb 5
Programming in C
goclasses2024-mockgate-14
programming
programming-in-c
pointers
1-mark
+
–
8
votes
2
answers
56
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 48
#include <stdio.h> int main() { int i= 255; short int *s= (short int *)&i; printf("%d\n", *s); } What will be the output of the above program in little-endian and big-endian, respectively? $(65280\text{ is } 255\times2^8)$ $255,\; 0$ $65280,\; 0$ $0,\;0$ $0,\; 65280$
#include <stdio.h int main() { int i= 255; short int *s= (short int *)&i; printf("%d\n", *s); }What will be the output of the above program in little-endian and big-endia...
GO Classes
519
views
GO Classes
asked
Jan 28
Programming in C
goclasses2024-mockgate-13
goclasses
programming
programming-in-c
little-endian-big-endian
output
2-marks
+
–
2
votes
1
answer
57
GATE CSE 2024 | Set 1 | Question: 38
Consider the following $\mathrm{C}$ function definition. int $\mathrm{f}$ (int $\mathrm{x}$, int $\mathrm{y})$ { for (int $i=0 ; i<y ; i++$ ) { $\mathrm{x}=\mathrm{x}+\mathrm{x}+\mathrm{y}$; } return $\mathrm{x}$; } Which of the ... $2^{10}$ If the inputs are $x=10, y=20$, then the return value is greater than $2^{20}$
Consider the following $\mathrm{C}$ function definition.int $\mathrm{f}$ (int $\mathrm{x}$, int $\mathrm{y})$ {for (int $i=0 ; i<y ; i++$ ) {$\mathrm{x}=\mathrm{x}+...
Arjun
1.9k
views
Arjun
asked
Feb 16
Programming in C
gatecse2024-set1
multiple-selects
programming
programming-in-c
+
–
1
votes
0
answers
58
GATE CSE SET-1 2024
My question is that can we use command line arguments without use of main function's parameters argc and *argv?
My question is that can we use command line arguments without use of main function's parameters argc and *argv?
RahulVerma3
75
views
RahulVerma3
asked
6 days
ago
Programming in C
programming-in-c
programming
+
–
5
votes
2
answers
59
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 27
What is a statically allocated variable in C programming? A variable allocated at an absolute address in a program’s data space A variable allocated on the stack A variable allocated on the heap A variable which can NOT be defined as local variable
What is a statically allocated variable in C programming? A variable allocated at an absolute address in a program’s data spaceA variable allocated on the stackA variab...
GO Classes
333
views
GO Classes
asked
Feb 5
Programming in C
goclasses2024-mockgate-14
programming
programming-in-c
storage-classes-in-c
1-mark
+
–
1
votes
1
answer
60
#OS-FORK Output
Q23. The following C program is executed on a Unix/Linux system: main() { int i=0; while (i<20) if (i%2==0) fork(); i++; return 0; } Calculate how many number of processes will be created after executing the above program. Options: 1.1023 2.Infinite 3.1024 4.2048
Q23. The following C program is executed on a Unix/Linux system: main(){ int i=0; while (i<20) if (i%2==0) fork(); ...
BitMask
248
views
BitMask
asked
Mar 3
Operating System
operating-system
fork-system-call
gate-preparation
programming-in-c
usermod
+
–
Page:
« prev
1
2
3
4
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register