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.
Recent activity in Programming in C
58
votes
3
answers
1
GATE CSE 2016 Set 1 | Question: 15
Consider the following C program. # include <stdio.h> void mystery (int *ptra, int *ptrb) { int *temp; temp = ptrb; ptrb =ptra; ptra = temp; } int main () { int a = 2016, b=0, c= 4, d = 42; mystery (&a, &b); if (a < c) mystery (&c, &a); mystery (&a, &d); printf("%d\n", a); } The output of the program is _________.
cprdereddyy
commented
in
Programming in C
Mar 24
by
cprdereddyy
17.9k
views
gatecse-2016-set1
programming-in-c
easy
numerical-answers
parameter-passing
0
votes
0
answers
2
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?
RahulVerma3
asked
in
Programming in C
Mar 22
by
RahulVerma3
33
views
programming-in-c
programming
100
votes
6
answers
3
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}$
maheshv21
commented
in
Programming in C
Mar 22
by
maheshv21
27.0k
views
gateit-2006
programming
programming-in-c
normal
structure
130
votes
3
answers
4
GATE CSE 2014 Set 2 | Question: 11
Suppose $n$ and $p$ are unsigned int variables in a C program. We wish to set $p$ to $^nC_3$. If $n$ is large, which one of the following statements is most likely to set $p$ correctly? $p = n * (n-1) * (n-2) / 6;$ $p = n * (n-1) / 2 * (n-2) / 3;$ $p = n * (n-1) / 3 * (n-2) / 2;$ $p = n * (n-1) * (n-2) / 6.0;$
cprdereddyy
commented
in
Programming in C
Mar 22
by
cprdereddyy
15.4k
views
gatecse-2014-set2
programming
programming-in-c
normal
11
votes
3
answers
5
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$
shihabkamel
commented
in
Programming in C
Mar 21
by
shihabkamel
5.7k
views
gatecse-2022
programming
programming-in-c
pointers
output
1-mark
37
votes
11
answers
6
GATE CSE 2021 Set 2 | Question: 10
Consider the following $\text{ANSI C}$ program. #include <stdio.h> int main() { int arr[4][5]; int i, j; for (i=0; i<4; i++) { for (j=0; j<5; j++) { arr[i][j] = 10 * i + j; } } printf(“%d”, *(arr[1]+9)); return 0; } What is the output of the above program? $14$ $20$ $24$ $30$
Subham640
answered
in
Programming in C
Mar 18
by
Subham640
29.9k
views
gatecse-2021-set2
programming-in-c
array
output
1-mark
46
votes
8
answers
7
GATE CSE 2015 Set 3 | Question: 7
Consider the following C program segment. # include <stdio.h> int main() { char s1[7] = "1234", *p; p = s1 + 2; *p = '0'; printf("%s", s1); } What will be printed by the program? $12$ $120400$ $1204$ $1034$
Subham640
answered
in
Programming in C
Mar 17
by
Subham640
16.0k
views
gatecse-2015-set3
programming
programming-in-c
normal
array
42
votes
9
answers
8
GATE CSE 2000 | Question: 1.16
Aliasing in the context of programming languages refers to multiple variables having the same memory location multiple variables having the same value multiple variables having the same identifier multiple uses of the same variable
Subham640
commented
in
Programming in C
Mar 17
by
Subham640
22.2k
views
gatecse-2000
programming
easy
aliasing
0
votes
0
answers
9
GATE 2024 CSE1
I have a question that can we use command line arguments without main function arguments? int main(int argc, char **argv){ }
RahulVerma3
asked
in
Programming in C
Mar 16
by
RahulVerma3
99
views
gatecse2024-set1
programming-in-c
2
votes
2
answers
10
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$
saurabh0709
comment edited
in
Programming in C
Mar 15
by
saurabh0709
2.5k
views
gatecse2024-set2
programming
programming-in-c
3
votes
2
answers
11
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$
saurabh0709
commented
in
Programming in C
Mar 14
by
saurabh0709
3.2k
views
gatecse2024-set2
programming
programming-in-c
0
votes
1
answer
12
C program
Predict the output of the following program. Void func (int n) { if (n > o) { func (n – 2); Print f ("% d", n – 1); Fun (n – 2); } } if 10 is passed as literal value : (1) 975921 (2) 951351 (3) 1315131713151317 (4) 131513713151319131513171315131 Your Answer: 3 Correct Answer: 4 Status: incorrect
teja1521
commented
in
Programming in C
Mar 13
by
teja1521
193
views
0
votes
1
answer
13
Gate 2017 Set 1 minimum Comparisons
Consider an array A of size 31 consisting of 0's followed by number of 1's. In order to find the smallest index i such that A[i]=1 minimum number of comparisons required in worst case by optimal algorithm?
teja1521
answered
in
Programming in C
Mar 11
by
teja1521
213
views
numerical-answers
algorithms
2
votes
2
answers
14
let x be an array of integer which of the following can not be present in the LHS of an assignment statement
teja1521
answer reshown
in
Programming in C
Mar 11
by
teja1521
2.6k
views
0
votes
2
answers
15
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
teja1521
commented
in
Programming in C
Mar 11
by
teja1521
2.2k
views
3
votes
2
answers
16
UGC NET CSE | June 2005 | Part 2 | Question: 15
Main() { char *str="abcde"; printf("%c",*str); printf("%c",*str++); printf("%c",*(str++)); printf("%s",str); } The output of the above $‘C’$ code will be : $\text{a a c b c d e}$ $\text{a a c c c d e}$ $\text{a a b c d e}$ None of these
ajayraho
commented
in
Programming in C
Mar 11
by
ajayraho
1.1k
views
ugcnetcse-june2005-paper2
programming-in-c
variable-scope
2
votes
3
answers
17
program output
char *c[] = {"GeksQuiz", "MCQ", "TEST", "QUIZ"}; char **cp[] = {c+3, c+2, c+1, c}; char ***cpp = cp; int main() { printf("%s ", **++cpp); printf("%s ", *--*++cpp+3); printf("%s ", *cpp[-2]+3); printf("%s ", cpp[-1][-1]+1); return 0; }
teja1521
commented
in
Programming in C
Mar 10
by
teja1521
4.2k
views
programming-in-c
pointers
29
votes
4
answers
18
GATE IT 2008 | Question: 49
What is the output printed by the following C code? # include <stdio.h> int main () { char a [6] = "world"; int i, j; for (i = 0, j = 5; i < j; a [i++] = a [j--]); printf ("%s\n", a); } dlrow Null string dlrld worow
Srken
commented
in
Programming in C
Mar 10
by
Srken
9.5k
views
gateit-2008
programming
programming-in-c
normal
array
35
votes
2
answers
19
GATE CSE 2020 | Question: 22
Consider the following C program. #include <stdio.h> int main () { int a[4] [5] = {{1, 2, 3, 4, 5}, {6, 7,8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17,18, 19, 20}}; printf(“%d\n”, *(*(a+**a+2)+3)); return(0); } The output of the program is _______.
Srken
commented
in
Programming in C
Mar 10
by
Srken
23.2k
views
gatecse-2020
numerical-answers
programming-in-c
array
1-mark
43
votes
3
answers
20
GATE CSE 2015 Set 3 | Question: 30
Consider the following two C code segments. $Y$ and $X$ are one and two dimensional arrays of size $n$ and $ n \times n$ respectively, where $2 \leq n \leq 10$. Assume that in both code segments, elements of $Y$ are initialized to $0$ ... $2$ are contiguous in main memory Only S2 is correct Only S3 is correct Only S1 and S2 are correct Only S1 and S3 are correct
Srken
commented
in
Programming in C
Mar 10
by
Srken
8.8k
views
gatecse-2015-set3
programming-in-c
normal
array
2
votes
2
answers
21
cil-2017
teja1521
commented
in
Programming in C
Mar 9
by
teja1521
393
views
cil-2017
50
votes
7
answers
22
GATE CSE 2016 Set 2 | Question: 35
The following function computes $X^{Y}$ for positive integers $X$ and $Y$. int exp (int X, int Y) { int res =1, a = X, b = Y; while (b != 0) { if (b % 2 == 0) {a = a * a; b = b/2; } else {res = res * a; b = b - 1; } } return res; } Which one of the following ... $X^{Y} = a^{b}$ $(res * a)^{Y} = (res * X)^{b}$ $X^{Y} = res * a^{b}$ $X^{Y} = (res * a)^{b}$
Surk
commented
in
Programming in C
Mar 8
by
Surk
13.9k
views
gatecse-2016-set2
programming
loop-invariants
normal
1
vote
1
answer
23
Array
Does C support fractional Indices? float x = some fraction; Is float a[x] valid declaration?
teja1521
answer edited
in
Programming in C
Mar 8
by
teja1521
138
views
array
programming-in-c
1
vote
2
answers
24
UPPCL AE 2018:34
What is the output of the following $\text{C}$ program? #include<stdio.h> int main(void){ char s1[] = “Hello”; char s2[] = “World!”; s1 = s2; printf(“%s”,s1); } “World!” “HelloWorld!” “Compilation error” “Hello”
teja1521
answered
in
Programming in C
Mar 8
by
teja1521
380
views
uppcl2018
programming
programming-in-c
output
2
votes
3
answers
25
Made Easy Mock -1
how does the program is working..? answer – 8
teja1521
answer edited
in
Programming in C
Mar 8
by
teja1521
405
views
programming
numerical-answers
made-easy-test-series
6
votes
3
answers
26
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
teja1521
answered
in
Programming in C
Mar 8
by
teja1521
395
views
goclasses2024-programming-2-weekly-quiz
goclasses
programming
programming-in-c
recursion
output
2-marks
3
votes
1
answer
27
Output of this program
main( ) { int n[3][3] = { 2, 4, 3, 6, 8, 5, 3, 5, 1 } ; printf ( "\n%d %d %d", *n, n[3][3], n[2][2] ) ; }
cprdereddyy
commented
in
Programming in C
Mar 7
by
cprdereddyy
1.4k
views
programming-in-c
pointers
programming
output
3
votes
2
answers
28
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$
Counsellor
edited
in
Programming in C
Mar 6
by
Counsellor
1.7k
views
gatecse2024-set2
programming
programming-in-c
3
votes
1
answer
29
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
Counsellor
edited
in
Programming in C
Mar 6
by
Counsellor
2.1k
views
gatecse2024-set2
programming
programming-in-c
multiple-selects
1
vote
3
answers
30
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
shah___
answered
in
Programming in C
Mar 6
by
shah___
2.7k
views
gatecse2024-set1
programming
programming-in-c
To see more, click for all the
questions in this category
.
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)
Programming in C
(4.1k)
Programming in Python
(5)
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 activity in Programming in C
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:...