search
Log In
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users Sep 2019
  1. Satbir

    567 Points

  2. Bikram

    566 Points

  3. GAITONDE

    348 Points

  4. Vimal Patel

    87 Points

  5. Shaik Masthan

    38 Points

  6. BLACK_CLOUD

    14 Points

  7. sekhar_1621

    13 Points

  8. OgbeborBeatrice

    13 Points

  9. RAMYA.F

    9 Points

  10. vkw1111

    9 Points

Recent questions tagged c-programming-for-gate

0 votes
0 answers 7 views
#include<stdio.h> void fun(int a, int b, int c){ printf("%d\n%d\n%d",a,b,c); } int main(){ int i,n=-1; fun(i=2,i>n,(i==2)?1:0); return 0; } According to me, answer should be:- 2 1 1. But when I run it, it is coming out to be 2 1 0
asked 4 days ago in Programming Sukhbir Singh 7 points 7 views
0 votes
0 answers 3 views
Consider a matrix M of integers. Divide M into 4 sub-matrices. These sub-matrices are called as Quadrants. Report the Quadrant number which has the smallest minimum-element. If two or more quadrants have same smallest minimum, report the smallest quadrant index. The ... greater than 1 and less than 12. OUTPUT FORMAT: Print in a separate line, the quadrant number with the smallest minimum-element.
asked Sep 7 in GATE ravi4407 6 points 3 views
0 votes
0 answers 5 views
There was a question asked in gate 2013 I am adding the link here https://gateoverflow.in/60/gate2013-42 there are these concepts called sequence point and side effects so, can anyone please explain these concepts in more detail as I am unable to get it however about ... there is little discussed in Dennis Ritchie's C but due to very little explanation I didn't get it at all. Thanks in advance.
asked Sep 7 in Programming setu bhaskar 7 points 5 views
0 votes
0 answers 17 views
what is the output of the following program? #include<stdio.h> #include<string.h> void fun1(char *p){ if(*p){ fun1(p+1); printf("%c",*p++); } } void fun2(char *p){ if(*p){ fun2(p+1); printf("%c",*p--); } } int main(){ char *str="FLOW"; fun2(str); printf("\t"); fun1(str); return 0; } (A) WOLF FLOW (B) WOLF WOLF (C) FLOW FLOW (D) Runtime error
asked Aug 29 in Programming ummokkate 45 points 17 views
0 votes
0 answers 15 views
#include<stdio.h> int main () { while(!printf("hello world" )); return0; } Please explain what happen under while condition and why it print hello world
asked Aug 28 in Programming Praful jha 10 points 15 views
0 votes
1 answer 12 views
#include<stdio.h> void main() { int i; for(i=0;i<=2;i++) { int i=8; printf("%d",i); } printf("%d",i); } output is 8883 please explain why 3 times 8 and why not onetime 8 than3
asked Aug 28 in Programming Praful jha 10 points 12 views
0 votes
0 answers 9 views
What will be the output of the following program? #include<stdio.h> int print 1(void) { static int x=10; x+=5; return x; } int print 2(void) { static int x X=10; x+=5; return x; } int main() { int x; x=print 1(); x+=print 1(); x+=print 2(); x+=print 2(); printf(“%d”,x); return 0; }
asked Aug 20 in Programming Ritabrata Dey 114 points 9 views
0 votes
0 answers 7 views
What is actual use of “memset” in programming?
asked Aug 6 in Programming srestha 182 points 7 views
0 votes
0 answers 4 views
What is the order of evaluation of function parameter in C language?
asked Aug 3 in Programming yashu24 10 points 4 views
0 votes
3 answers 36 views
What should be the output according to inner and outer printf #include<stdio.h> int main() { printf("%d",printf("ravi ")); printf("\n"); }
asked Jul 30 in Programming shivam001 9 points 36 views
0 votes
0 answers 9 views
#include <stdio.h> char str1[100]; char *mystery(char str[]) { static int i = 0; if (*str) { mystery(str+1); str1[i] = *str; i++; } return str1; } int main() { char str[] = "ehT etaG kooB"; printf("%s", mystery(str)); return 0; } Plz provide a detailed explanation
asked Jul 25 in Puzzles s_dr_13 8 points 9 views
1 vote
2 answers 23 views
Can someone explain the solution of this question? #include <stdio.h> char *c[] = {"GatsQuiz", "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; } (a) TEST sQuiz Z CQ (b) MCQ Quiz Z CQ (c) TEST Quiz Z CQ (d) GarbageValue sQuiz Z CQ
asked Jul 23 in Programming yashu24 10 points 23 views
0 votes
1 answer 9 views
0 votes
1 answer 20 views
What would the following program return? #include<stdio.h> int p(int n){ static int a=1; if(n<=1) return a; else{ a=a*p(n-1); } } void main() { printf("%d",p(6)); } Here notice that the else statement in p(int n) does not have return.
asked Jul 16 in Programming Sambhrant Maurya 204 points 20 views
0 votes
0 answers 11 views
Please provide the step by step explanation for this question as few things are more confusing here. #include <stdio.h> #define PRINT(format, x) printf(#x " = %" #format "\n", x) int integer = 5; char character = '5'; char *string = "5"; main() { PRINT(d, string); PRINT(d, character); ... = 2 ux = 37777777776 x/2 = 1 ux/2 = 2147483647 x/2 = 1 ux >> 1 = 17777777777 x >> 1 = 1 ux >> 1 = 2147483647
asked Jul 15 in Programming `JEET 144 points 11 views
0 votes
0 answers 11 views
The output of following code is: #include<stdio.h> char* foo(char *s) { char *s1 = s; while(*s1!=0) { (*s1)++; s1++; } return s; } int main() { char *str = "GATEFORUM"; printf("%s", foo(str)); return 0; } (A) GATEFORUM (B) HBUFGPSVN (C) ... answer is B but here in function foo() s1 is pointing to a string constant ( GATEFORUM ) which cannot be modified. So (*s1)++ should throw an error right?
asked Jul 14 in Programming Sambhrant Maurya 204 points 11 views
–2 votes
0 answers 12 views
Write a C Program using Printf statement to print BYE in the following format : BBB Y Y EEEE B B Y Y E BBB Y EEEE B B Y
asked Jul 11 in Programming meakshaymishra 46 points 12 views
0 votes
1 answer 20 views
#include <stdio.h> void main(){ int i=0; for(i<=5&&i>=-1;++i;i>0){ printf("%d\t", i); } } What is the output?
asked Jul 9 in Programming Sathuri Bharath 30 points 20 views
0 votes
1 answer 12 views
#include <stdio.h> void main() { printf("%x and int is %d\n", -1>>1, -1>>1 ); } what is the output?
asked Jul 9 in Programming Sathuri Bharath 30 points 12 views
0 votes
1 answer 11 views
Are these two segments same or different? S1: static int a = 10; a++; S2: static int a; a = 10; a++;
asked Jun 30 in Programming GoalSet1 9 points 11 views
1 vote
1 answer 27 views
Done my bachelors in ECE. I want to know where to start from and all the topics that need to be covered one after other starting with C programming then data structures. I found people suggesting books and resources online but didn’t find any credible source giving a list of all the topics in each subject.
asked Jun 28 in GATE rajenderashwin 7 points 27 views
To see more, click for the full list of questions or popular tags.
...