| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| If 4 digits number is input through the keyboard, Write a
program to calculate sum of its 1st & 4th digit. | | 4 |
| how the size of an integer is decided?
- is it based on processor or compiler or OS? | nvidia | 16 |
| class foo {
public:
static int func(const char*& p) const;
};
This is illegal, why? | Google | 6 |
| what is a function pointer and how all to declare ,define
and implement it ??? | Honeywell | 3 |
| what is y value of the code if input x=10
y=5;
if (x==10)
else if(x==9)
elae y=8;
a.9
b.8
c.6
d.7
| TCS | 2 |
| How can we see the Expanded source code and compiled code
for our source program in C? | | 1 |
| How many types of linked lists what are they?
How many types of data structures? | BSNL | 5 |
| Predict the output or error(s) for the following:
25. main()
{
printf("%p",main);
}
| ME | 3 |
| What is the difference between char a[] = "string"; and
char *p = "string"; ? | Honeywell | 11 |
| What are .h files and what should I put in them? | | 3 |
| How to set a variable in the environment list? | | 1 |
| how does printf function work | | 1 |
| What will be printed as the result of the operation below:
#include<..>
int x;
int modifyvalue()
{
return(x+=10);
}
int changevalue(int x)
{
return(x+=1);
}
void main()
{
int x=10;
x++;
changevalue(x);
x++;
modifyvalue();
printf("First output:%d\n",x);
x++;
changevalue(x);
printf("Second output:%d\n",x);
modifyvalue();
printf("Third output:%d\n",x);
} | | 2 |
| 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 | 4 |
| Write a C++ program without using any loop (if, for, while
etc) to print numbers from 1 to 100 and 100 to 1;
| | 7 |
| what is the output of the following program?
#include<stdio.h>
void main()
{
int x=4,y=3,z;
z=x-- -y;
printf("\n%d %d %d",x,y,z);
} | | 10 |
| What is the memory allocated by the following definition ?
int (*x)[10];
| ADITI | 3 |
| 6)swap(int x,y)
{
int temp;
temp=x;
x=y;
y=temp;
}
main()
{
int x=2;y=3;
swap(x,y);
}
after calling swap ,what are yhe values x&y?
| | 2 |
| char S;
char S[6]= " HELLO";
printf("%s ",S[6]);
output of the above program ?
(0, ASCII 0, I,unpredictable)
| Mascot | 6 |
| Why cann't whole array can be passed to function as value. | | 1 |
| |
| For more C Interview Questions Click Here |