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 for Programming:
Recent questions tagged programming
0
votes
0
answers
1
Programming and DS
Trying out a code to get all the possible marks that can be obtained in a GATE paper. Assumptions taken : 1) All questions are MCQs (all questions have a chance of negative marking) 2) 30 1-mark questions, 35 2-mark questions 3) Static array without any ... a[i]); return 0; } The console doesn't output anything. Any suggestions on where might I be going wrong/ the error lies?
Mrityudoot
asked
in
Object Oriented Programming
Feb 26
by
Mrityudoot
94
views
programming-in-c
output
programming
0
votes
1
answer
2
GATE DS&AI 2024 | Question: 28
Consider the following Python code: def count(child_dict, i): if i not in child_dict.keys(): return 1 ans $=1$ for $j$ in child_dict[i]: ans $+=$ count (child_dict, j) return ans child_dict $=$ dict () child_dict $[0]=[1,2]$ child_dict $[1]=[3,4,5]$ ... $)$ ) Which ONE of the following is the output of this code? $6$ $1$ $8$ $9$
Arjun
asked
in
Programming in Python
Feb 17
by
Arjun
758
views
gate-ds-ai-2024
programming
0
votes
2
answers
3
GATE DS&AI 2024 | Question: 31
Consider the following Python function: def $\operatorname{fun}(D, s 1, s 2)$ : if $\mathrm{s} 1
Arjun
asked
in
Programming in Python
Feb 17
by
Arjun
827
views
gate-ds-ai-2024
programming
2
votes
2
answers
4
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$
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
3.1k
views
gatecse2024-set2
programming
programming-in-c
3
votes
1
answer
5
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 always ... ${ }^{*} \mathrm{C}=$ "abcd" in main (), the function call $\mathrm{fX}(\mathrm{c})$ will always return a value
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
2.0k
views
gatecse2024-set2
programming
programming-in-c
multiple-selects
2
votes
2
answers
6
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$
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
2.4k
views
gatecse2024-set2
programming
programming-in-c
3
votes
2
answers
7
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$
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
1.6k
views
gatecse2024-set2
programming
programming-in-c
3
votes
3
answers
8
GATE CSE 2024 | Set 1 | Question: 8
Consider the following $\mathrm{C}$ program: #include <stdio.h> int main() { int a=6; int b = 0; while (a<10) { a = a / 12+1 ; a += b ;} printf ("%d", a); return 0 ; } Which one of the following ... The program prints $9$ as output The program prints $10$ as output The program gets stuck in an infinite loop The program prints $6$ as output
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
5.4k
views
gatecse2024-set1
programming
programming-in-c
1
vote
3
answers
9
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 ! = '\n ... The 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
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
2.6k
views
gatecse2024-set1
programming
programming-in-c
2
votes
1
answer
10
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}$
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
1.8k
views
gatecse2024-set1
multiple-selects
programming
programming-in-c
5
votes
1
answer
11
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 16
Consider the following C code: double A[2][3] = {{1, 2, 3}, {4, 5, 6}}; Assume that A[0] = 0xFFAA0000 and the sizeof(double) is 8. What will be the value of `A[1]`? 0xFFAA0024 0xFFAA0003 0xFFAA000C 0xFFAA0018
GO Classes
asked
in
Programming in C
Feb 5
by
GO Classes
457
views
goclasses2024-mockgate-14
programming
programming-in-c
array
1-mark
5
votes
2
answers
12
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
GO Classes
asked
in
Programming in C
Feb 5
by
GO Classes
320
views
goclasses2024-mockgate-14
programming
programming-in-c
storage-classes-in-c
1-mark
7
votes
2
answers
13
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)$
GO Classes
asked
in
Programming in C
Feb 5
by
GO Classes
408
views
goclasses2024-mockgate-14
programming
programming-in-c
pointers
1-mark
4
votes
1
answer
14
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 42
The provided C code is a version of the C string library function strlen(), which calculates the length of a given string. unsigned int mystrlen(char *c) { unsigned int i = 0; /* Your code here. */ } Which line of code creates a working and accurate version of ... + i) != '\0') i++; return i; while (*(c + i) != '\0') ++i; return i;
GO Classes
asked
in
Programming in C
Feb 5
by
GO Classes
359
views
goclasses2024-mockgate-14
programming
programming-in-c
strings
multiple-selects
2-marks
4
votes
1
answer
15
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 43
What will be the output of the following C program? #include <stdio.h> void Mickey(int**, int, int); void Mouse(int, int*); int main() { int a = 2, b = 3, c = 4; int *points = &a; Mickey(&points, b, c); printf("%d", ... x; *p = **points+1; Mouse(z, p); return; } void Mouse(int z, int *p) { *p = *p+1; return; }
GO Classes
asked
in
Programming in C
Feb 5
by
GO Classes
348
views
goclasses2024-mockgate-14
numerical-answers
programming
programming-in-c
functions
2-marks
4
votes
1
answer
16
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 54
Consider the following pseudocode procedure. Which of the following best describes procedure mystery? It returns a list of numbers from 1 to $n$. It prints every third number from 1 to $n$. It returns the sum of the numbers from 1 to $\mathrm{n}$. It returns the sum of the multiples of 3 from 1 to $n$.
GO Classes
asked
in
Programming in C
Feb 5
by
GO Classes
187
views
goclasses2024-mockgate-14
programming
programming-in-c
functions
2-marks
0
votes
0
answers
17
Memory Based GATE DA 2024 | Question: 20
Consider the following Python code: S[1] = [1] x = [6, 3, 5, 4, 10] for i in range(2, len(x)): S[i] = [1] if x[i - 1]
GO Classes
asked
in
Programming
Feb 5
by
GO Classes
94
views
gate2024-da-memory-based
goclasses
programming
programming-in-python
0
votes
0
answers
18
Memory Based GATE DA 2024 | Question: 21
What does the following Python code do? \begin{verbatim} def fun(D, S_1, S_2): if S_1 < S_2: D[S_1], D[S_2] = D[S_2], D[S_1] fun(D, S_1 + 1, S_2 - 1) \end{verbatim}
GO Classes
asked
in
Programming
Feb 5
by
GO Classes
86
views
gate2024-da-memory-based
goclasses
programming
programming-in-python
0
votes
0
answers
19
Memory Based GATE DA 2024 | Question: 49
Consider the following Python code: def countchildren(l, i): Some code Given lists if i > 2: return 1 ans = 1 for i in l.keys(): ans = ans + countchildren(l,i) return ans Example usage l = dict() l[1] = [2, 3] l[2] = [3, 4, 5] l[3] = [6, 7, 8] result = countchildren(l,1) print(result)
GO Classes
asked
in
Programming
Feb 5
by
GO Classes
82
views
gate2024-da-memory-based
goclasses
programming
programming-in-python
5
votes
1
answer
20
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 18
What will be output printed by the following program? #include<stdio.h> main() { int c=4; switch(c) { c=c-1; case 4: printf("IITB "); break; default: printf("IISc "); case 3: printf("IITM "); case ... ;IITD"); } } $\text{IITB IITM}$ $\text{IITB IISc IITM}$ $\text{IITB}$ $\text{IITB IITM IITD}$
GO Classes
asked
in
Programming in C
Jan 28
by
GO Classes
333
views
goclasses2024-mockgate-13
goclasses
programming
programming-in-c
output
1-mark
4
votes
0
answers
21
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 19
What will be the output of the following program? #include <stdio.h> int main() { int a[2][2] = { {1, 2}, {3, 4} }; int (*p)[2][2]; p = &a; printf("%d", (*p)[0][1]); return 0; } $1$ $2$ $3$ $4$
GO Classes
asked
in
Programming in C
Jan 28
by
GO Classes
277
views
goclasses2024-mockgate-13
goclasses
programming
programming-in-c
array-of-pointers
1-mark
3
votes
1
answer
22
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 47
#include<stdio.h> #include<string.h> char upstr[50]; void putStar (int n,char str[]){ upstr[n] = str[n]; if(n == strlen(str)) return; else upstr[n+1] = '*'; putStar(n+1,str); } int main() { char str[] = "hello"; ... ;, upstr); } What will be the output of the given program? h*e*l*l*o h*e*l*l*o* h*e*l*l* hello
GO Classes
asked
in
Programming in C
Jan 28
by
GO Classes
291
views
goclasses2024-mockgate-13
goclasses
programming
programming-in-c
array
2-marks
8
votes
2
answers
23
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$
GO Classes
asked
in
Programming in C
Jan 28
by
GO Classes
506
views
goclasses2024-mockgate-13
goclasses
programming
programming-in-c
little-endian-big-endian
output
2-marks
2
votes
1
answer
24
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 12
Consider the following two declarations for $\textsf{arr1}$ and $\textsf{arr2}:$ int arr1[2][3]; int r1[3]; int r2[3]; int * arr2[2] = {r1, r2}; Assume that the size of the integer is $4$ Bytes and the ... $\operatorname{sizeof}(\operatorname{arr}1)=48$ bytes and sizeof $(\operatorname{arr}2)=32$ bytes
GO Classes
asked
in
Programming in C
Jan 21
by
GO Classes
393
views
goclasses2024-mockgate-12
goclasses
programming
programming-in-c
array-of-pointers
1-mark
6
votes
2
answers
25
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 13
What will be the output of following program ? #include <stdio.h> int thefunction(int a) { static int b = 0; b++; a = a + b; return a; } int main() { int b = 0; int i; for (i = 1; i <= 3; i++) { b = b + thefunction(i); } printf("%d\n", b); return 0; }
GO Classes
asked
in
Programming in C
Jan 21
by
GO Classes
462
views
goclasses2024-mockgate-12
goclasses
numerical-answers
programming
programming-in-c
storage-classes-in-c
1-mark
6
votes
1
answer
26
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 14
What will be the output of the following program? main() { int a[2][2] = { {1,2},{3,4} }; int(*p)[2][2]; p = &a; printf("%d", (*p)[0][0]); } $1$ $3$ $4$ None of these
GO Classes
asked
in
Programming in C
Jan 21
by
GO Classes
390
views
goclasses2024-mockgate-12
goclasses
programming
programming-in-c
array
output
1-mark
5
votes
1
answer
27
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 26
What will be the output of the following C program? #include<stdio.h> void main() { int i=6; for(--i; --i; i--) { printf("%d",i); } } $42$ $31$ Infinite loop None of these
GO Classes
asked
in
Programming in C
Jan 21
by
GO Classes
433
views
goclasses2024-mockgate-12
goclasses
programming
programming-in-c
output
2-marks
1
vote
1
answer
28
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 27
Consider the following C program:- #include <stdio.h> void ubswap(int **a, int **b) { int* temp = *a; *a = *b; *b = temp; } int main() { int x = 1, y = 9; int* u = &x; int* v = &y; int** a = &u; int** b ... $\text{ return 0 }?$ $x$ and $y$ $u$ and $v$ $a$ and $b$ None of the above
GO Classes
asked
in
Programming in C
Jan 21
by
GO Classes
435
views
goclasses2024-mockgate-12
goclasses
programming
programming-in-c
pointers
2-marks
Page:
1
2
3
4
5
6
...
32
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)
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
(24)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(682)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
243k
comments
79.7k
users
Recent questions tagged programming
Recent Blog Comments
Hlo I'm Rupesh I got AIR 3485 in gate CS and AIR...
@Ajay Sasank here is the direct link...
Thank you for the post didi My GATE 2023 & 2024...
I Hope it helps 😊
Today's best post I seen thank you for motivation