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 interview
0
votes
2
answers
61
Prog \ What is the output of the following program? tricky question
#include<stdio.h> int main() { int a = 5; switch(a) { default: a = 4; case 6: a--; case 5: a = a+1; case 1: a = a-1; } printf("%d \n",a); return 0; } (a) 5 (b) 4 (c) 3 (d) None of these
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
8.8k
views
output
programming-in-c
interview
7
votes
1
answer
62
Prog \ What is the output of the following program?
#include <stdio.h> void f(char**); int main() { char *argv[] = { "ab", "cd", "ef", "gh", "ij", "kl" }; f(argv); return 0; } void f(char **p) { char *t; t = (p += sizeof(int ... \n", t); } (a) ab (b) cd (c) ef (d) gh In GATE Exam, if not specified What should be size of integer?
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
1.4k
views
programming-in-c
output
pointers
interview
0
votes
1
answer
63
Prog / What is the output of the following program?
#include<stdio.h> int main() { char c=125; c=c+10; printf("%d",c); return 0; } (a) 135 (b) +INF (c) -121 (c) -8
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
5.1k
views
programming-in-c
output
interview
0
votes
1
answer
64
Prog \ What is the output of the following program?
#include<stdio.h> int main() { int i=10; static int x=i; if(x==i) printf("Equal"); else if(x>i) printf("Greater"); else printf("Lesser"); return 0; } (a) Equal (b) Greater (c) Lesser (d) Compile Error
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
1.6k
views
programming-in-c
output
interview
0
votes
1
answer
65
Prog \ Predict the output.
#include <stdio.h> int main() { int i = 3; int j; j = sizeof(++i + ++i); printf("i=%d j=%d\n", i, j); return 0; } (a) i=4 j=4 (b) i=3 j=4 (c) i=5 j=4 (d) the behavior is undefined
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
2.7k
views
programming-in-c
output
interview
0
votes
1
answer
66
Prog\ What is the output of the following program?
#include<stdio.h> int a = 10; int main() { fun(); fun(); return 0; } int fun() { static int a = 1; printf("%d ",a); a++; return 0; }
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
521
views
programming-in-c
pointers
output
interview
0
votes
1
answer
67
Prog \ What is the output of the following program?
#include<stdio.h> #include<stdlib.h> int main() { char s[] = "Opendays2012"; int i = 0; while(*(s++)) i++; printf("%d",i); return 0; } (a) Segmentation Fault (b) Compile Error (c) 12 (d) 0
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
600
views
programming-in-c
pointers
output
interview
array
1
vote
1
answer
68
Programming \ What is the output of the following program?
#include<stdio.h> void foo(char *); int main() { char *string = "Hello"; foo(string); printf("%s",string); return 0; } void foo(char *a) { while(*a) { *a += 1; a++; } } (a) Hello (b) Ifmmp (c) Compile Error (d) Segmentation fault
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
2.0k
views
programming-in-c
output
interview
pointers
0
votes
0
answers
69
Programming \ What is the output of the following program?
#include <stdio.h> void foo(int[][3]); int main(void) { int a[3][3] = { {1, 2, 3}, {4, 5, 6}, {7, 8, 9} }; foo(a); printf("%d\n", a[2][1]); return 0; } void foo(int b[][3]) { ++b; b[1][1] = 9; } (a) 8 (b) 9 (c) 7 (d) none of the above
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
599
views
programming-in-c
output
interview
array
0
votes
1
answer
70
Programming \ What is the output of the following program?
#include <stdio.h> int main(void) { char a[5] = { 1, 2, 3, 4, 5 }; char *ptr = (char*)(&a + 1); printf("%d %d\n", *(a + 1), *(ptr - 1)); return 0; } options are : (a) Compile Error (b) 2 1 (c) 2 5 (d) none of the above
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
392
views
programming-in-c
output
interview
pointers
0
votes
2
answers
71
Programming \ what is the output?
#include<stdio.h> int main() { int a[10][20][30]={0}; printf("%ld",&a+1 - &a); return 0; }
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
1.6k
views
programming-in-c
output
interview
array
0
votes
2
answers
72
Programming \ What is the output of this Program ?
Prog 1 : #include<stdio.h> #include<string.h> void foo(char *); int main() { char a[100] = {0}; printf("%lu %lu",sizeof(a),strlen(a)); return 0; } Prog 2 #include<stdio.h> #include<string.h> int main() { char string[] = "Hello"; printf("%lu %lu",sizeof(string),strlen(string)); return 0; }
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
1.9k
views
programming-in-c
output
interview
0
votes
1
answer
73
Programming \ predict the output
#include<stdio.h> int main() { char str[] = {'a','b','c','\0'}; str[0] -= 32; printf("%s",str); return 0; }
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
459
views
programming-in-c
output
interview
0
votes
2
answers
74
What does the following function do?
int foo( int a, int b) { int c = a-b; c = c&(0x80000000); return (!c)*a +(!!c)*b; }
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
818
views
programming-in-c
interview
0
votes
0
answers
75
Programming \What is the following function doing ?
unsigned fun(unsigned int a) { unsigned int i, x = 0, y = 0, z = 0; for(i = 0; i < 16; i++) { y <<= 2; y += !!(a & 0x80000000) << 1; y += !!(a & 0x40000000); a <<= 2; x = x + (x&1); x <<= 1; z <<= 1; if(x + 1 <= y) { x++; z++; y-=x; } } return z; }
Desert_Warrior
asked
in
Programming in C
May 16, 2016
by
Desert_Warrior
447
views
programming-in-c
interview
Page:
« prev
1
2
3
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 interview
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:...