Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Webpage
Programming in C.
Recursion.
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Recent questions in Programming and DS
1
vote
0
answers
301
Self doubt - printing null character from a character array.
We use character array to declare string in C. So, if I declare an array like character ch[ ] = {‘a’,’k’,’a’,’/o’}; and try printing ch[3] like : printf(“%C”,ch[3]); what will be the output ?
aakash pandey
asked
in
Programming in C
Apr 30, 2022
by
aakash pandey
294
views
programming-in-c
strings
3
votes
1
answer
302
GO Classes Test Series 2024 | Programming | Test 3 | Question: 15
If the $32$-bit number given below is stored in little-endian at address $1000,$ what is the value of the byte at address $1002?$ Answer in decimal. $0001\; 0010 \;0011\; 0100\; 0101\; 0110\; 0111\; 1000$ This number is the same as $12345678$ in hexadecimal.
GO Classes
asked
in
Programming in C
Apr 30, 2022
by
GO Classes
432
views
goclasses2024-programming-3-weekly-quiz
numerical-answers
goclasses
programming
programming-in-c
number-representation
2-marks
2
votes
1
answer
303
GO Classes Test Series 2024 | Programming | Test 3 | Question: 16
What will be printed by the following program? #include<stdio.h> int func(int n, int * fg) { int t, f; if (n <= 1) { *fg = 1; return 1; } t = func(n - 1, fg); f = t + *fg; *fg = t; return f; } int main() { int x = 15; printf("%d\n", func(5, &x)); }
GO Classes
asked
in
Programming in C
Apr 30, 2022
by
GO Classes
280
views
goclasses2024-programming-3-weekly-quiz
numerical-answers
goclasses
programming
programming-in-c
functions
2-marks
3
votes
1
answer
304
GO Classes Test Series 2024 | Programming | Test 3 | Question: 19
#include<stdio.h> int test(int *a, int *b) { int c = *a-*b; if (c<0) return 0; else return (1 + test(&c, b)); } void main() { int x = 15; int y = 4; int a = test(&x,&y); printf("%d", a); } $2$ $3$ $4$ Run time error since we can not pass the address of local variable c in the function test.
GO Classes
asked
in
Programming in C
Apr 30, 2022
by
GO Classes
393
views
goclasses2024-programming-3-weekly-quiz
goclasses
programming
programming-in-c
functions
pointers
parameter-passing
recursion
2-marks
3
votes
1
answer
305
GO Classes Test Series 2024 | Programming | Test 3 | Question: 21
Consider the following C code where main shows the intended use of the functions relating to struct foo. struct foo { int x; int y; int * p; }; struct foo* make_foo() { struct foo *foo = malloc(sizeof( ... program has a dangling pointer Given program may result in run time error Given program will result in a compile-time error
GO Classes
asked
in
Programming in C
Apr 30, 2022
by
GO Classes
576
views
goclasses2024-programming-3-weekly-quiz
goclasses
programming
programming-in-c
structure
pointers
multiple-selects
2-marks
3
votes
1
answer
306
GO Classes Test Series 2024 | Programming | Test 3 | Question: 22
What does the following program print? #include<stdio.h> #include<string.h> struct MdbRec { char name[16]; char msg[24]; }; int main() { struct MdbRec m[1]; strcpy(m[0].name, "dude"); strcpy(m[0].msg, " ... printf("%d", m->msg - (char *)m ); } Prints nothing Prints $17$ Prints $24$ Prints $16$
GO Classes
asked
in
Programming in C
Apr 30, 2022
by
GO Classes
566
views
goclasses2024-programming-3-weekly-quiz
goclasses
programming
programming-in-c
structure
array
multiple-selects
2-marks
3
votes
2
answers
307
GO Classes Test Series 2024 | Programming | Test 3 | Question: 23
What will be the output of the following lines of code? int i = 0; int j = 0; char *s = "ceded"; while (s[i] != '\0') { j = j + s[i] - 'b'; i = i + 1; } printf("%d %d\n", i, j); $5\; 11$ $4\; 16$ $5\; 16$ $4 \;11$
GO Classes
asked
in
Programming in C
Apr 30, 2022
by
GO Classes
288
views
goclasses2024-programming-3-weekly-quiz
goclasses
programming
programming-in-c
loop
output
2-marks
3
votes
1
answer
308
GO Classes Test Series 2024 | Programming | Test 3 | Question: 26
What will be the output of the following C program? #include<stdio.h> int main() { static int p[] = {1, 2, 3, 0, 5, 6}; static int *q[] = {p+2, p+1, p, p+3, p+4, p+5}; static int **r[] = {q+4, q+5, q+1, q, q+2, q+3}; int ***pt; pt = r + 2; printf("%d", ***(pt+3)-**(q+1)); }
GO Classes
asked
in
Programming in C
Apr 30, 2022
by
GO Classes
437
views
goclasses2024-programming-3-weekly-quiz
numerical-answers
goclasses
programming
programming-in-c
array
pointers
array-of-pointers
2-marks
5
votes
1
answer
309
GO Classes Test Series 2024 | Programming | Test 3 | Question: 29
Mark all options which are likely to create problems with memory, i.e., run time error or have a memory leak. Assume malloc is always successful, and sizes are as follows - sizeof(int *) = 8 bytes sizeof(double) = 8 bytes sizeof(char) = 1 ... 4 int *p = malloc(sizeof(char)); *p = 0; Program $1$ Program $2$ Program $3$ Program $4$
GO Classes
asked
in
Programming in C
Apr 30, 2022
by
GO Classes
570
views
goclasses2024-programming-3-weekly-quiz
goclasses
programming
programming-in-c
pointers
multiple-selects
2-marks
4
votes
1
answer
310
GO Classes Test Series 2024 | Programming | Test 3 | Question: 30
What will be the output of the following program? It is given that $\textsf{sizeof(int) = 4}$ and $\textsf{sizeof(int *) = 8.}$ #include<stdio.h> main(){ void** p = 1000; int* q = ((int*)(p + 1)) - 1; printf("%u", q); } $1000$ $1008$ $1004$ Error, since $p+1$ is not allowed as $p$ is declared as void.
GO Classes
asked
in
Programming in C
Apr 30, 2022
by
GO Classes
347
views
goclasses2024-programming-3-weekly-quiz
goclasses
programming
programming-in-c
pointers
2-marks
0
votes
1
answer
311
A frame buffer array is addressed in row major order for a monitor with pixel locations starting from (0,0) and ending with (100,100). What is address of the pixel(6,10)? Assume one bit storage per pixel and starting pixel location is at 0. 1) 1016 2)1006 3) 610 4)616
viral8702
asked
in
Programming in C
Apr 29, 2022
by
viral8702
463
views
data-structures
array
0
votes
0
answers
312
C programming - code
what is the ouput of this code ? main() { int x = 10; int y = (++x) + (--x); printf(“%d”,y); } and i am confuse about this code specifically about this expression int y = (++x) + (--x); so if this expression is wrong so what the wrong about this expression and topic related to “Precedence and associativity”
closed
ykrishnay
asked
in
Programming in C
Apr 27, 2022
by
ykrishnay
276
views
programming-in-c
programming
0
votes
0
answers
313
write down a program to implement n queen problem using constraint programming approch when n=4
cse
geraad
asked
in
Programming in C
Apr 26, 2022
by
geraad
105
views
8
votes
1
answer
314
GO Classes Test Series 2024 | Programming | Test 2 | Question: 3
Consider two files given below. //file1.c #include<stdio.h> main () { extern int i; printf("file1"); } //file2.c #include<stdio.h> main () { int i =1; printf("file2"); } We compile ... compiled independently but can not be linked together file$1$.c can be compiled and linked independently of file$2$.c.
GO Classes
asked
in
Programming in C
Apr 24, 2022
by
GO Classes
655
views
goclasses2024-programming-2-weekly-quiz
goclasses
programming
programming-in-c
storage-classes-in-c
multiple-selects
1-mark
5
votes
1
answer
315
GO Classes Test Series 2024 | Programming | Test 2 | Question: 9
What will be the output of running file main.c? write.c *********************** extern int count; void write_extern() { count +=2; } main.c *********************** #include "write.c" #include<stdio.h> int count = 5; main() { write_extern(); write_extern(); printf("%d", count); } $0$ $5$ $9$ None of these
GO Classes
asked
in
Programming in C
Apr 24, 2022
by
GO Classes
353
views
goclasses2024-programming-2-weekly-quiz
goclasses
programming
programming-in-c
storage-classes-in-c
output
1-mark
3
votes
1
answer
316
GO Classes Test Series 2024 | Programming | Test 2 | Question: 20
Consider the following two .c files, which both include the same .h file: When compiled, linked, and executed, the following output results: $x = 1 \; y = 2\; z = 3\; w = 4\; v = 5$ Assuming that this program compiled and linked ... Line$(6)$ - empty Line$(7)$ - empty Line$(8)$ - static Line$(9)$ - empty Line$(10)$ - static
GO Classes
asked
in
Programming in C
Apr 24, 2022
by
GO Classes
432
views
goclasses2024-programming-2-weekly-quiz
goclasses
programming
programming-in-c
storage-classes-in-c
2-marks
6
votes
3
answers
317
GO Classes Test Series 2024 | Programming | Test 2 | Question: 21
What will be the output of the following program? #include<stdio.h> int rec(int x, int y) { static int count = 0; if (x == 0) return count; count++; if (x > y) rec(x - y, y); else rec(x, y - x); return count; } main() { int i = 10, j = 2, n; n = rec(i, j); printf("%d", n); } $4$ $5$ $6$ Infinite loop
GO Classes
asked
in
Programming in C
Apr 24, 2022
by
GO Classes
411
views
goclasses2024-programming-2-weekly-quiz
goclasses
programming
programming-in-c
recursion
output
2-marks
6
votes
1
answer
318
GO Classes Test Series 2024 | Programming | Test 2 | Question: 23
What will be the output of the program below- int i = 1; void my_extern1(void); void my_extern2(void); int main() { int count = 0; while (i++<5) { static int i = 3; i++; count +=i; my_extern1(); } printf("%d", ... (); } void my_extern2(){ extern int i; if (i++ < 3) my_extern1(); } Infinite recursion $9$ $4$ $5$
GO Classes
asked
in
Programming in C
Apr 24, 2022
by
GO Classes
336
views
goclasses2024-programming-2-weekly-quiz
goclasses
programming
programming-in-c
recursion
output
2-marks
0
votes
1
answer
319
How to find a range of float,double,long in c programming?
How to find a range of float,double,long in c programming? just like we find the range in case of int (signed,unsigned),char (signed ,unsigned) in c programming language ? like integer unsigned range is 0 to 65535 and so on for other data types ? Thank you ahead
ykrishnay
asked
in
Programming in C
Apr 23, 2022
by
ykrishnay
243
views
algorithms
programming-in-c
programming
number-system
digital-logic
5
votes
1
answer
320
GO Classes 2023 | Weekly Quiz 8 | Question: 2
Consider below four program fragments. Which of the program(s) is/are likely to produce run time error or memory leak. Assume malloc is always successful, and sizes are as follows - sizeof(int *) = 8 bytes sizeof(double) = 8 bytes sizeof(char) = 1 byte sizeof( ... ] = %d\n", a[0], a[1]); return 0; } Program $1$ Program $2$ Program $3$ Program $4$
GO Classes
asked
in
Programming in C
Apr 21, 2022
by
GO Classes
1.2k
views
goclasses_wq8
goclasses
programming
programming-in-c
multiple-selects
2-marks
Page:
« prev
1
...
11
12
13
14
15
16
17
18
19
20
21
...
309
next »
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Programming
(4.1k)
DS
(2.0k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(684)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
244k
comments
80.0k
users
Recent questions in Programming and DS
Recent Blog Comments
category ?
Hi @Arjun sir, I have obtained a score of 591 in ...
download here
Can you please tell about IIT-H mtech CSE self...
Please add your admission queries here:...
Network Sites
GO Mechanical
GO Electrical
GO Electronics
GO Civil
CSE Doubts
Aptitude Overflow