Login
Register
Dark Mode
Brightness
Ambient Glow – Questions list
Register
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged c-programming
9
9 votes
4
4 answers
320
320 views
GO Classes DPP | GATE CS | C Programming | Static Global & External Access
Given the following two files, what will happen when they are compiled and linked together?file1.cstatic int count = 3; void update() { count = count + 1; }main.c#include...
GO Classes
320
views
asked
Jun 10
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-294
programming-in-c
c-programming
goclasses-c-programming-practice-questions
static-scoping
+
–
5
5 votes
3
3 answers
218
218 views
GO Classes DPP | GATE CS | C Programming | Extern & Linker Error
What will happen when the following code is compiled and linked?#include <stdio.h int main() { extern int a; printf("%d", a); return 0; }$\texttt{0}$ Garbage value Compil...
GO Classes
218
views
asked
Jun 10
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-294
programming-in-c
c-programming
goclasses-c-programming-practice-questions
extern-variable
+
–
6
6 votes
2
2 answers
203
203 views
GO Classes DPP | GATE CS | C Programming | Extern Variable Declaration
What is the output of the following code?#include <stdio.h int main() { extern int i; printf("%d", i); return 0; } int i = 100;Garbage value $\texttt{0}$ $\texttt{100}$ C...
GO Classes
203
views
asked
Jun 10
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-294
programming-in-c
c-programming
goclasses-c-programming-practice-questions
extern-variable
+
–
5
5 votes
1
1 answer
179
179 views
GO Classes DPP | GATE CS | C Programming | Preprocessor Directives
In which stage is the following code#include <stdio.h>is replaced by the contents of the file $\texttt{stdio.h}$?During editing During linking During execution During pre...
GO Classes
179
views
asked
Jun 10
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-294
programming-in-c
c-programming
goclasses-c-programming-practice-questions
+
–
5
5 votes
1
1 answer
195
195 views
GO Classes DPP | GATE CS | C Programming | Extern Function Declaration
Is there any difference between the following declarations?extern int fun(); int fun();Both are identical No difference, except $\texttt{extern int fun();}$ is probably i...
GO Classes
195
views
asked
Jun 10
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-294
programming-in-c
c-programming
goclasses-c-programming-practice-questions
+
–
6
6 votes
3
3 answers
252
252 views
GO Classes DPP | GATE CS | C Programming | Register Variable
What is the output of the following code?#include <stdio.h int main() { register int x = 10; int *p = &x; printf("%d", *p); return 0; }$\texttt{10}$ $\texttt{0}$ Garbage ...
GO Classes
252
views
asked
Jun 9
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-293
programming-in-c
c-programming
goclasses-c-programming-practice-questions
variable-scope
+
–
8
8 votes
2
2 answers
223
223 views
GO Classes DPP | GATE CS | C Programming | Auto Variable
What can be said about the output of the following code?#include <stdio.h int main() { auto int x; printf("%d", x); return 0; }Output is always $\texttt{0}$ Output is alw...
GO Classes
223
views
asked
Jun 9
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-293
programming-in-c
c-programming
goclasses-c-programming-practice-questions
variable-scope
+
–
8
8 votes
2
2 answers
216
216 views
GO Classes DPP | GATE CS | C Programming | Global Variable
What is the output of the following code?#include <stdio.h int a; static int b; int main() { printf("%d %d", a, b); return 0; }$\texttt{0\ 0}$ Garbage values $\texttt{1\ ...
GO Classes
216
views
asked
Jun 9
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-293
programming-in-c
c-programming
goclasses-c-programming-practice-questions
variable-scope
global-variable
+
–
7
7 votes
2
2 answers
245
245 views
GO Classes DPP | GATE CS | C Programming | Static Local Variable
What is the output of the following code?#include <stdio.h void fun() { static int x = 1; x = x + 2; printf("%d ", x); } int main() { fun(); fun(); fun(); return 0; }$\te...
GO Classes
245
views
asked
Jun 9
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-293
programming-in-c
c-programming
goclasses-c-programming-practice-questions
variable-scope
static-scoping
+
–
7
7 votes
2
2 answers
215
215 views
GO Classes DPP | GATE CS | C Programming | Local and Global Variables
What is the output of the following code?#include <stdio.h int x = 10; int main() { int x = 20; printf("%d", x); return 0; }
GO Classes
215
views
asked
Jun 9
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-293
programming-in-c
c-programming
goclasses-c-programming-practice-questions
variable-scope
+
–
6
6 votes
2
2 answers
261
261 views
GO Classes DPP | GATE CS | C Programming | Structure Initialization
What is the output of the following code?#include <stdio.h struct Point { int x; int y; }; int main() { struct Point p = {4, 7}; p.x = p.x + 3; p.y = p.x + p.y; printf("%...
GO Classes
261
views
asked
Jun 8
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-292
programming-in-c
c-programming
goclasses-c-programming-practice-questions
structure
+
–
5
5 votes
2
2 answers
229
229 views
GO Classes DPP | GATE CS | C Programming | Structures
What is the output of the following code?#include <stdio.h struct Student { int roll; int marks; }; int main() { struct Student s1; s1.roll = 10; s1.marks = 85; printf("%...
GO Classes
229
views
asked
Jun 8
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-292
programming-in-c
c-programming
goclasses-c-programming-practice-questions
structure
+
–
11
11 votes
2
2 answers
232
232 views
GO Classes DPP | GATE CS | C Programming | Macro Expansion
What is the output of the following code?#include <stdio.h #define SQUARE(x) x * x int main() { int a = 3; int result = SQUARE(a + 1); printf("%d", result); return 0; }$\...
GO Classes
232
views
asked
Jun 8
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-292
programming-in-c
c-programming
goclasses-c-programming-practice-questions
macros
+
–
8
8 votes
3
3 answers
239
239 views
GO Classes DPP | GATE CS | C Programming | Recursion Trace
What is the output of the following code?#include <stdio.h int fun(int n) { if (n <= 1) return n; return fun(n - 1) + fun(n - 3); } int main() { printf("%d", fun(5)); ret...
GO Classes
239
views
asked
Jun 8
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-292
programming-in-c
c-programming
goclasses-c-programming-practice-questions
recursion
numerical-answers
+
–
7
7 votes
3
3 answers
228
228 views
GO Classes DPP | GATE CS | C Programming | Pointer Aliasing
What is the output of the following code?#include <stdio.h void update(int *p, int *q) { *p = *p + 2; *q = *q + 3; *p = *p + *q; } int main() { int a = 5; update(&a, &a);...
GO Classes
228
views
asked
Jun 8
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-292
programming-in-c
c-programming
goclasses-c-programming-practice-questions
pointers
numerical-answers
+
–
8
8 votes
2
2 answers
292
292 views
GO Classes DPP | GATE CS | C Programming | Nested Loops
What is the output of the following code?#include <stdio.h int main() { int i, j, sum = 0; for (i = 1; i <= 4; i++) { for (j = 1; j <= 5; j++) { if (j % i == 0) continue;...
GO Classes
292
views
asked
Jun 6
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-291
programming-in-c
c-programming
goclasses-c-programming-practice-questions
for-loop
numerical-answers
+
–
7
7 votes
1
1 answer
229
229 views
GO Classes DPP | GATE CS | C Programming | Static Variable in Recursion
What is the output of the following code?#include <stdio.h int solve(int n) { static int x = 1; if (n == 0) return x; x = x + n; return solve(n - 1); } int main() { print...
GO Classes
229
views
asked
Jun 6
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-291
programming-in-c
c-programming
goclasses-c-programming-practice-questions
pointers
+
–
6
6 votes
1
1 answer
222
222 views
GO Classes DPP | GATE CS | C Programming | Structures and Pass by Value
What is the output of the following code?#include <stdio.h struct Student { int marks; }; void update(struct Student s) { s.marks = s.marks + 10; } int main() { struct St...
GO Classes
222
views
asked
Jun 6
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-291
programming-in-c
c-programming
goclasses-c-programming-practice-questions
structure
+
–
7
7 votes
1
1 answer
192
192 views
GO Classes DPP | GATE CS | C Programming | Recursion
What is the output of the following code?#include <stdio.h int fun(int n) { if (n == 0) return 1; return n * fun(n - 2); } int main() { printf("%d", fun(6)); return 0; }
GO Classes
192
views
asked
Jun 6
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-291
programming-in-c
c-programming
goclasses-c-programming-practice-questions
recursion
numerical-answers
+
–
7
7 votes
1
1 answer
215
215 views
GO Classes DPP | GATE CS | C Programming | Pointer to Pointer
What is the output of the following code?#include <stdio.h int main() { int a = 5, b = 10; int *p = &a; int q = &p; q = q + 3; p = &b; q = q + a; printf("%d %d", a, ...
GO Classes
215
views
asked
Jun 6
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-291
programming-in-c
c-programming
goclasses-c-programming-practice-questions
pointers
+
–
7
7 votes
1
1 answer
202
202 views
GO Classes DPP | GATE CS | C Programming | Functions and Pointers
What is the output of the following code?#include <stdio.h void change(int *p, int *q) { *p = *p + 4; *q = *p + *q; p = q; *p = *p - 3; } int main() { int a = 6, b = 10; ...
GO Classes
202
views
asked
Jun 6
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-290
programming-in-c
c-programming
goclasses-c-programming-practice-questions
pointers
+
–
8
8 votes
1
1 answer
191
191 views
GO Classes DPP | GATE CS | C Programming | Nested Loops
What is the output of the following code?#include <stdio.h int main() { int i, j, count = 0; for (i = 1; i <= 4; i++) { for (j = 1; j <= 4; j++) { if (i * j 6) break; co...
GO Classes
191
views
asked
Jun 6
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-290
programming-in-c
c-programming
goclasses-c-programming-practice-questions
+
–
7
7 votes
1
1 answer
178
178 views
GO Classes DPP | GATE CS | C Programming | Recursion
What is the output of the following code?#include <stdio.h int calc(int n) { if (n == 1) return 2; return n + calc(n - 1); } int main() { printf("%d", calc(4)); return 0;...
GO Classes
178
views
asked
Jun 6
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-290
programming-in-c
c-programming
goclasses-c-programming-practice-questions
recursion
numerical-answers
+
–
7
7 votes
1
1 answer
201
201 views
GO Classes DPP | GATE CS | C Programming | Static Variables in Functions
What is the output of the following code?#include <stdio.h void fun() { static int x = 3; int y = 2; x = x + y; y = y + x; printf("%d ", x); } int main() { fun(); fun(); ...
GO Classes
201
views
asked
Jun 6
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-290
programming-in-c
c-programming
goclasses-c-programming-practice-questions
functions
+
–
7
7 votes
1
1 answer
207
207 views
GO Classes DPP | GATE CS | C Programming | Pointers
What is the output of the following code?#include <stdio.h int main() { int a = 8, b = 12; int *p = &a; int *q = &b; *p = *p + *q; q = p; *q = *q - 5; printf("%d %d", a, ...
GO Classes
207
views
asked
Jun 6
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-290
programming-in-c
c-programming
goclasses-c-programming-practice-questions
pointers
+
–
9
9 votes
2
2 answers
357
357 views
GO Classes DPP | GATE CS | C Programming | Pointers
What is the output of the following code?#include <stdio.h int main() { int a = 10, b = 20; int *p, *q; p = &a; q = &b; *p = *p + 5; *q = *p + *q; p = q; *p = *p - 10; pr...
GO Classes
357
views
asked
Jun 5
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-289
programming-in-c
c-programming
goclasses-c-programming-practice-questions
pointers
+
–
8
8 votes
3
3 answers
321
321 views
GO Classes DPP | GATE CS | C Programming | Switch Case
What is the output of the following code?#include <stdio.h int main() { int x = 3, y = 1; switch (x - 1) { case 1: y = y + 2; case 2: y = y * 3; case 3: y = y - 1; break;...
GO Classes
321
views
asked
Jun 5
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-289
programming-in-c
c-programming
goclasses-c-programming-practice-questions
numerical-answers
+
–
5
5 votes
2
2 answers
244
244 views
GO Classes DPP | GATE CS | C Programming | Break and Continue
What is the output of the following code?#include <stdio.h int main() { int i, j, count = 0; for (i = 1; i <= 4; i++) { for (j = 1; j <= 4; j++) { if (i == j) continue; i...
GO Classes
244
views
asked
Jun 5
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-289
programming-in-c
c-programming
goclasses-c-programming-practice-questions
numerical-answers
+
–
3
3 votes
2
2 answers
261
261 views
GO Classes DPP | GATE CS | C Programming | Functions & Pass by Value
What is the output of the following code?#include <stdio.h int update(int x) { x = x + 3; return x * 2; } int main() { int a = 4, b; b = update(a); printf("%d %d", a, b);...
GO Classes
261
views
asked
Jun 5
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-289
programming-in-c
c-programming
goclasses-c-programming-practice-questions
functions
+
–
5
5 votes
2
2 answers
289
289 views
GO Classes DPP | GATE CS | C Programming | Loop Control
What is the output of the following code?#include <stdio.h int main() { int a[5] = {2, 4, 1, 3, 5}; int i, sum = 0; for (i = 0; i < 5; i++) { if (a[i] % 2 == 0) sum = sum...
GO Classes
289
views
asked
Jun 5
Programming in C
goclasses
goclasses-cs-dpp
goclasses-cs-dpp-day-289
programming-in-c
c-programming
goclasses-c-programming-practice-questions
array
loop
+
–
Page:
« prev
1
2
3
4
5
next »