Skip to content
Gblog GeeksforGeeks True Geek Tournament – 7 Days Marathon to Earn the ‘True Geek’ Title!
Do you remember the childhood days, when cricket was the major reason for living to you and how excited you used to be for that… Read More
Output? # include<stdio.h> # include<stdlib.h>     void fun(int *a) {     a = (int*)malloc(sizeof(int)); }     int main() {     int *p;     fun(p);     *p = 6;     printf("%d\n",*p);… Read More
Consider the following three C functions : [PI] int * g (void)  {    int x= 10;    return (&x);  }        [P2] int * g (void) … Read More
The most appropriate matching for the following pairs (GATE CS 2000) X: m=malloc(5); m= NULL;        1: using dangling pointers Y: free(n); n->value=5;         2: using uninitialized… Read More
#include <stdio.h>    int main()  {    int i;      for (i = 1; i != 10; i += 2)      printf(" GeeksQuiz ");    return 0;  } (A) GeeksQuiz… Read More
#include<stdio.h>  int main(void)  {    int a = 1;    int b = 0;    b = a++ + a++;    printf("%d %d",a,b);    return 0;  } (A) 3 6… Read More
#include<stdio.h>  int main()  {    char *s[] = { "knowledge","is","power"};    char **p;    p = s;    printf("%s ", ++*p);    printf("%s ", *p++);    printf("%s ", ++*p);         return… Read More
Output? #include<stdio.h>  #define f(g,g2) g##g2  int main()  {     int var12 = 100;     printf("%d", f(var,12));     return 0;  } (A) 100 (B) Compiler Error (C) 0 (D)… Read More
Predict the output of following program. Assume that the numbers are stored in 2’s complement form. #include<stdio.h>  int  main()  {     unsigned int x = -1; … Read More
#include <stdio.h>  int main()  {    int a = 10, b = 20, c = 30;    if (c > b > a)      printf("TRUE");    else     printf("FALSE");    return… Read More
#include <stdio.h> int main()  {    int x = 10;    static int y = x;         if(x == y)       printf("Equal");    else if(x > y)       printf("Greater");    else… Read More
#include<stdio.h>  struct st  {      int x;      struct st next;  };       int main()  {      struct st temp;      temp.x = 10;      temp.next = temp;      printf("%d", temp.next.x); … Read More
Output? #include <stdio.h> int fun() {   static int num = 16;   return num--; }    int main() {   for(fun(); fun(); fun())     printf("%d ", fun());   return… Read More
#include<stdio.h> int main() {   typedef int *i;   int j = 10;   i *a = &j;   printf("%d", **a);   return 0; } (A) Compiler Error (B) Garbage… Read More
Output? #include<stdio.h> int main() {    typedef int i;    i a = 0;    printf("%d", a);    return 0; } (A) Compiler Error (B) Runtime Error (C) 0… Read More
#include<stdio.h> int main() {   typedef static int *i;   int j;   i a = &j;   printf("%d", *a);   return 0; } (A) Runtime Error (B) 0 (C)… Read More