| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| To what value are pointers initialized?
1) NULL
2) Newly allocated memory
3) No action is taken by the compiler to initialize
pointers.
| | 2 |
| int main()
{
int *p=new int;
*p=10;
del p;
cout<<*p;
*p= 60;
cout<<*p;
}
what will be the output & why? | TCS | 3 |
| consider the following program sigment
int n,sum=1;
switch(n) {
case 2:sum=sum+2;
case 3:sum*=2;
break;
default:sum=0;}
if n=2, what is the value of sum
a.0
b.6
c.3
d.none
| TCS | 3 |
| wats the diference btwen constant pointer and pointer to a
constant.pls give examples. | | 4 |
| what is the other ways to find a logic to print whether a
number is an even or odd wit out using % symbol??????? i
know three different ways to print it. so i need any other
different logic>>>>> | TCS | 3 |
| write a c program to accept a given integer value and print
its value in words | | 2 |
| can you explain in brief what is "r+" mode in a file... i
know that it si used to read and modify rhe existing
content.... but explalanation about the file pointer in "r+"
mode i wann to know??????????? | Cognizent | 1 |
| which types of data structure will i use to convert infix to
post fix??? | IIT | 2 |
| Difference between fopen() and open()? | Aricent | 1 |
| Why does not use getgh(); and <conio.h> in c language. | Elofic | 1 |
| proc() {
static i=10;
printf("%d",i);
}
If this proc() is called second time, what is the output?
| Hughes | 5 |
| What's wrong with "char *p = malloc(10);" ? | | 4 |
| How many ways are there to swap two numbers without using
temporary variable? Give the each logic. | | 4 |
| what is the function of .h in #include<stdio.h> in c ? | IBM | 4 |
| main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s\n",p2);
}
what is the output?
| Ramco | 3 |
| int zap(int n)
{
if(n<=1)then zap=1;
else zap=zap(n-3)+zap(n-1);
}
then the call zap(6) gives the values of zap
[a] 8 [b] 9 [c] 6 [d] 12 [e] 15
| Wipro | 6 |
| what is memory leak?
| | 3 |
| what will be the output:
main(){char ch;int a=10;printf("%d",ch);} | Wipro | 25 |
| what are the uses of structure? | HCL | 3 |
| # define prod(a,b)=a*b
main()
{
int x=2;
int y=3;
printf("%d",prod(x+2,y-10)); }
the output of the program is
a.8
b.6
c.7
d.none
| TCS | 5 |
| |
| For more C Interview Questions Click Here |