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
Recent questions tagged go-programming-1
8
votes
2
answers
1
GATE Overflow | Programming | Test 1 | Question: 28
int foo(int n) { if(n > 10000) return 1; int sum = 0, i; for( i = 0; i < n; i++) { sum += i; } return sum; } The value returned by the above function is $\Theta\left(n^2\right)$ $\Theta\left(n\right)$ $\Theta\left(1\right)$ $\Omega\left(n^2\right)$
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.2k
views
go-programming-1
programming
asymptotic-notation
programming-in-c
5
votes
1
answer
2
GATE Overflow | Programming | Test 1 | Question: 30
Consider the following incomplete C function for reversing a singly linked list. node* reverse(node* trav){ if(trav->next) __________________ else { head -> next = null; head = trav; } return trav; } Here, head is a global pointer pointing to ... = trav; trav->next -> next = trav; trav -> next = trav; trav = reverse(trav->next);
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.6k
views
go-programming-1
programming
programming-in-c
linked-list
3
votes
2
answers
3
GATE Overflow | Programming | Test 1 | Question: 29
What will be the output of the following code? #include <stdio.h> #include <string.h> int main() { struct mystruct{ char *name; unsigned int age; }; struct mystruct st1 = {"Ram", 12}; printf("%lu %u", strlen(st1.name), st1.age); } 4 12 3 12 compile error run time error
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.1k
views
go-programming-1
programming
programming-in-c
1
vote
3
answers
4
GATE Overflow | Programming | Test 1 | Question: 27
Which of the following statements is true regarding C language? S1: C is a functional language S2: C is a declarative language S3: C is a procedural language S4: C is a structured language S1, S2 and S3 only S2 and S4 only S2, S3 and S4 only S1, S3 and S4 only
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
3.2k
views
go-programming-1
programming
programming-in-c
3
votes
4
answers
5
GATE Overflow | Programming | Test 1 | Question: 26
What will be the output of the following code? #include <stdio.h> int main() { char a = 'A', z = 'Z'; printf("%d", z-a); }
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
772
views
go-programming-1
programming
programming-in-c
numerical-answers
8
votes
1
answer
6
GATE Overflow | Programming | Test 1 | Question: 25
int foo1(float a) { int b = a; return b/2; } int foo2(double a) { int b = a; return b/2; } int foo3(unsigned int a) { int b = a; return b/2; } Consider the above three C functions and choose ... error foo2 and foo3 return the same value for all input integer values but not foo1 All 3 functions return different value for some input integer values
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.6k
views
go-programming-1
programming
programming-in-c
7
votes
4
answers
7
GATE Overflow | Programming | Test 1 | Question: 24
The output of the following C program will be (assume IEEE-754 floating point representation) #include <stdio.h> int main() { float a = 0.25; if(a == 0.25) printf("Hello"); printf(" World"); } Hello World World Compile Error Hello
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
2.9k
views
go-programming-1
programming
7
votes
2
answers
8
GATE Overflow | Programming | Test 1 | Question: 23
The value returned by the following function for foo(10) is ____ int foo(int x) { if(x < 1) return 1; int sum = 0; for(int i = 1; i <= x; i++) { sum += foo(x-i); } return sum; }
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.2k
views
go-programming-1
programming
numerical-answers
6
votes
4
answers
9
GATE Overflow | Programming | Test 1 | Question: 22
Which one among the following definitions of string str could cause problem when passed as the first argument to printf function? char str[] = "Hello World"; char str[12] = "Hello World"; char *str = " ... ,'l','o',' ','W','o','r','l','d'};
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.7k
views
go-programming-1
programming
programming-in-c
2
votes
5
answers
10
GATE Overflow | Programming | Test 1 | Question: 21
The value returned by the following code is _____ int foo() { int a[] = { 10, 20, 30, 40, 50, 60 }; int *p = &a[1] , *q = &a[5] ; return q-p; }
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.6k
views
go-programming-1
programming
programming-in-c
numerical-answers
9
votes
2
answers
11
GATE Overflow | Programming | Test 1 | Question: 20
Which of the following statements is correct? S1: A struct object will always occupy more space than an union object having the same elements. S2: Given an int array Arr and a struct object Str both having same size in memory, Arr[100] ... size in memory. Only S1 is correct Only S2 is correct Both S1 and S2 are correct Neither S1 nor S2 is correct
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
2.0k
views
go-programming-1
programming
programming-in-c
3
votes
1
answer
12
GATE Overflow | Programming | Test 1 | Question: 19
Arnold is a novice in C and by mistake he typed "intt" for all usage of "int" in a C code. Which of the following statement added at the beginning of the code should fix the issue for him? typedef int intt; typedef intt int; #define intt int; #define intt int 1 and 3 2 and 4 3 and 4 1 and 4
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
662
views
go-programming-1
programming
programming-in-c
6
votes
3
answers
13
GATE Overflow | Programming | Test 1 | Question: 18
Consider the following two C codes: Code 1 Code 2 char *a = "hello world"; printf(a); char a[] = "hello world"; printf(a); Both are valid C codes Code 1 is valid but not code 2 Code 2 is valid but not code 1 Both codes are not valid in C
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.5k
views
go-programming-1
programming
programming-in-c
12
votes
1
answer
14
GATE Overflow | Programming | Test 1 | Question: 17
#include <stdio.h> int foo(int a[100]) { return sizeof(a); } int main() { int a[10]; printf("%d", foo(a)); } What will be the output of the above code ignoring any compiler warnings and assuming sizeof(int) as 4 when run on a 64 bit machine?
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.8k
views
go-programming-1
programming
programming-in-c
numerical-answers
3
votes
1
answer
15
GATE Overflow | Programming | Test 1 | Question: 16
What is the number of tokens in the below C code? int foo(int i, int j){ return printf(" I do it correctly", i > j); }
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
906
views
go-programming-1
programming
compiler-tokenization
numerical-answers
11
votes
4
answers
16
GATE Overflow | Programming | Test 1 | Question: 15
Which of the following statements produce a compile time error in C? int a = sizeof 3; *(1000) = 5; int a = 5; ((int)a)++; int b = 5, *a = &b; ((int*)a)++; 1, 2 and 3 2 only 2, 3 and 4 All 4
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
2.1k
views
go-programming-1
programming
programming-in-c
6
votes
2
answers
17
GATE Overflow | Programming | Test 1 | Question: 14
void foo(int x) { int *p = &x; *p = x*x; } The above code is supposed to modify any input integer with its square. Which of the following statements regarding the above code is correct? The given code is wrong as ... not returning any value The given code is wrong as it is illegal to access the memory of a parameter variable inside a function
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
881
views
go-programming-1
programming
programming-in-c
parameter-passing
11
votes
2
answers
18
GATE Overflow | Programming | Test 1 | Question: 13
What is the following function doing? unsigned int foo(unsigned int x) { unsigned int c = sizeof x; c <<= 3; if(x == 0) return c; c--; while(x = x & x-1) c--; return c; } Counting the number ... the number of set bits in the binary representation of x Counting the number of unset bits in the binary representation of x None of the above
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.7k
views
go-programming-1
programming
identify-function
5
votes
4
answers
19
GATE Overflow | Programming | Test 1 | Question: 12
What will be returned by the following function foo when called as foo(10)? int foo(int n) { return n & n | 1; }
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.3k
views
go-programming-1
programming
numerical-answers
bitwise
7
votes
2
answers
20
GATE Overflow | Programming | Test 1 | Question: 11
What will be the outout of the following code? #include <stdio.h> int main() { int a = 1, b = 2; int c = a++ || b++; printf("%d %d %d", a, b, c); } 1 2 1 2 3 1 2 2 1 2 2 0
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
865
views
go-programming-1
programming
programming-in-c
short-circuit-rule
4
votes
2
answers
21
GATE Overflow | Programming | Test 1 | Question: 10
What will be the output of the following program? #include <stdio.h> void f1(int p1, int *p2, int **p3) { p1 = 20; *p2 = p1; **p3 = *p2; p1 = 10; } int main() { int a = 5, b = 5, *c = &b; f1(a, &b, &c); printf("%d %d %d", a, b, *c); } 5 5 5 5 20 20 10 20 20 20 20 20
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
765
views
go-programming-1
programming
programming-in-c
pointers
3
votes
2
answers
22
GATE Overflow | Programming | Test 1 | Question: 9
No. of times '*' will be printed by the following C code is _____ #include<stdio.h> void foo(int x) { switch(x){ case 1: printf("*"); case 2: printf("*"); case 3: printf("*"); default: printf("*"); } } int main() { foo(2.5); }
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.1k
views
go-programming-1
programming
programming-in-c
switch-case
numerical-answers
6
votes
2
answers
23
GATE Overflow | Programming | Test 1 | Question: 8
What is the output of this program? #include <stdio.h> int main() { char *ptr; char string[] = "Hello 2017"; ptr = string; ptr += 4; printf("%s",++ptr); } Hello 2017 ello 2017 2017 o 2017
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
623
views
go-programming-1
programming
programming-in-c
pointers
9
votes
2
answers
24
GATE Overflow | Programming | Test 1 | Question: 7
The output for the following C program will be #include <stdio.h> int temp; int new(int t) { static int cal; cal = cal + t; return(cal); } int main() { int t, p; for(t=0; t<=4; t++) p = new(t) + ++temp; printf("%d", p); } 25 20 15 Garbage Value
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.0k
views
go-programming-1
programming
programming-in-c
7
votes
3
answers
25
GATE Overflow | Programming | Test 1 | Question: 6
The output of the following C program will be _____ #include<stdio.h> #define type int type foo(type b) { return b*b; } #undef type #define type float int main() { float a = foo(1.1); printf("%1.2f", a); }
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.6k
views
go-programming-1
programming
programming-in-c
data-types
numerical-answers
10
votes
3
answers
26
GATE Overflow | Programming | Test 1 | Question: 5
Consider the following usage of variable a where b is an appropriate pointer variable. int * b = &a; Which of the following declarations is invalid for a? auto int a; register int a; static int a; const int a; 1 and 2 4 only 2 only 2 and 4
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.6k
views
go-programming-1
programming
programming-in-c
5
votes
3
answers
27
GATE Overflow | Programming | Test 1 | Question: 4
Consider the following C functions: int f1(int a, int b) { while (a != b) { if(a > b) a = a - b; else b = b - a; } return a; } int f2(int a, int b) { while (b != 0) { int t = b; ... for all positive inputs but not f3 For some positive input all 3 functions return different values f2 and f3 return same value for all positive inputs but not f1
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
2.4k
views
go-programming-1
programming
programming-in-c
identify-function
10
votes
7
answers
28
GATE Overflow | Programming | Test 1 | Question: 3
What will be the output of the following code? #include <stdio.h> #include <string.h> int main() { char string[] = "Hello"; if(sizeof(string) <= strlen(string)) printf("1"); printf("0"); } ______
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.8k
views
go-programming-1
programming-in-c
programming
numerical-answers
8
votes
2
answers
29
GATE Overflow | Programming | Test 1 | Question: 2
Consider the following C function: void foo() { int a[10][20][30] = {0}; __________ printf("%d", a[3][4][5]); } Which of the following could be used in the missing line so that the output is 2? a[3][4][5] = 2; *(*(*(a+3) + 4) + 5) = 2; (*(*(a ... *((int*)a + 3 * 20 * 30 + 4 * 30 + 5) = 2; Only 1 and 2 Only 1, 2 and 3 Only 1 1, 2, 3 and 4
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.3k
views
go-programming-1
programming
programming-in-c
pointers
4
votes
2
answers
30
GATE Overflow | Programming | Test 1 | Question: 1
What will be the output of the following C program? #include <stdio.h> int main() { int f1(int,int); int x = 9,n = 3; printf("%d", f1(x, n)); } int f1(int x, int n) { int y = 1,i = 1; for(i = 1;i <= n; i++) y = y * x; return(y); } 27 729 81 Compilation Error
Arjun
asked
in
Programming in C
Oct 18, 2016
by
Arjun
1.2k
views
go-programming-1
programming
programming-in-c
To see more, click for the
full list of questions
or
popular tags
.
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
(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 tagged go-programming-1
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:...