Select chapter



functions (3.papers)
loops (1.papers)
arrays (2.papers)
structures (3.papers)
unions (1.papers)
pointers (7.papers)
null pointers (1.papers)
strings (2.papers)
misc c concepts (1.papers)
Data structures (5.papers)
linked lists (3.papers)
trees (1.papers)
basics (5.papers)
Hide

Sponsored Links


  

c basics interview questions and answers

1
what is the difference between prototype and signature of a function?
  1. signature talks only about function name, no of parameters, type and order of parameters. it wont talk about return type of the function.
  2. prototype means option 1 + return type.
  3. signature talks about function name, no of parameters, type, order of parameters and return type of the function.
  4. none
Show Answer
Share Facebook gmail Twitter
2
If local and global variables are having same name, then which one will be given more priority?
  1. if local is static then local is given priority, else global are given high priority.
  2. compiler will give error.
  3. global will be given more priority.
  4. Local will be given more priority.
Show Answer
Share Facebook gmail Twitter
3
what is the difference between static local variables and static global variables in c?
  1. life time of both the variables is same, but global will be accessed by any file in that program and locals can be accessed by functions of that file only.
  2. life time of both the variables is same, but global will be accessed by any function in that file and locals will can be accessed by only that function.
  3. static locals will die on function exit, static global alive through out program execution. scope is same for both.
  4. static locals will die on function exit, static global alive through out program execution. static locals can be accessed with in that function, global can be accessed by any function in that file.
Show Answer
Share Facebook gmail Twitter
4
Where does static variables will be stored?
  1. data segment
  2. heap
  3. stack
  4. registers
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
13
what is the order of priority for below operators?

a. !
b. *
c. +
d. <
e. != 
f. &&
g. ||
h. =
  1. a,b,c,d,e,f,g,h
  2. a,c,d,b,e,g,h,f
  3. a,d,c,b,e,f,h,g
  4. h,g,f,e,d,a,b,c
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
15
example for c label goto:

What will be the output of this below program?

#include  <stdio.h>

main( )
{
    HOME:
    printf("welcome\n");
    goto VIRUS;
    printf("I am at home\n");
    VIRUS: goto HOME;
}
  1. It prints welcome infinite times, and crashes.
  2. it prints welcome, i am at home for infinite times, and crashes
  3. it won't print any thing and it crashes
  4. welcome, i am at home.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
17
If we don't declare a function prototype, and made a call to that function, then what does compiler assumes about that prototype in c language?
  1. compiler assumes that you are passing int and function returns int.
  2. compiler assumes that you are passing int to that function, and function returns void.
  3. compiler assumes that you are not passing anything to that function, and function returns void.
  4. it assumes nothing.
Show Answer
Share Facebook gmail Twitter
18
Does register variables always get stored in CPU registers?
  1. yes
  2. never
  3. register is just a request to cpu, so if it is required, then only they will be stored in registers.
  4. none of the above
Show Answer
Share Facebook gmail Twitter
19
Address of register variable in c: Is it possible to get the address of variables declared as registers, by using & operator?
  1. Yes it is possible
  2. No, it is not possible it gives compile time error.
  3. it gives run time error.
  4. it is not possible, but it doesn't give any error.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Read more papers :