| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| main()
{
int i=0;
while(+(+i--)!=0)
i-=i++;
printf("%d",i);
} | | 1 |
| void main()
{
char far *farther,*farthest;
printf("%d..%d",sizeof(farther),sizeof(farthest));
} | | 1 |
| main()
{
int i, j, *p;
i = 25;
j = 100;
p = &i; // Address of i is assigned to pointer p
printf("%f", i/(*p) ); // i is divided by pointer p
}
a. Runtime error.
b. 1.00000
c. Compile error
d. 0.00000 | HCL | 1 |
| main()
{
int i = 100;
clrscr();
printf("%d", sizeof(sizeof(i)));
}
a. 2
b. 100
c. 4
d. none of the above | HCL | 2 |
| main()
{
clrscr();
}
clrscr(); | | 1 |
| void main()
{
void *v;
int integer=2;
int *i=&integer;
v=i;
printf("%d",(int*)*v);
} | | 1 |
| main()
{
int i=300;
char *ptr = &i;
*++ptr=2;
printf("%d",i);
} | | 1 |
| print numbers till we want without using loops or condition
statements like specifically(for,do while, while swiches,
if etc)!
| | 7 |
| Print an integer using only putchar. Try doing it without
using extra storage. | | 1 |
| main()
{
char c=' ',x,convert(z);
getc(c);
if((c>='a') && (c<='z'))
x=convert(c);
printf("%c",x);
}
convert(z)
{
return z-32;
} | | 1 |
| What is the output for the following program
main()
{
int arr2D[3][3];
printf("%d\n", ((arr2D==* arr2D)&&(* arr2D ==
arr2D[0])) );
} | | 1 |
| 1. const char *a;
2. char* const a;
3. char const *a;
-Differentiate the above declarations. | | 2 |
| print a semicolon using Cprogram without using a semicolon
any where in the C code in ur program!!
| Tata-Elxsi | 19 |
| main()
{
char *p;
p="Hello";
printf("%c\n",*&*p);
} | | 1 |
| void main()
{
static int i=5;
if(--i){
main();
printf("%d ",i);
}
} | | 1 |
| main()
{
int i=5;
printf("%d%d%d%d%d%d",i++,i--,++i,--i,i);
} | | 1 |
| main()
{
char *p = “ayqm”;
printf(“%c”,++*(p++));
} | TCS | 2 |
| void main()
{
int i=5;
printf("%d",i+++++i);
} | | 1 |
| Write a prog to accept a given string in any order and flash
error if any of the character is different.
For example : If abc is the input then abc, bca, cba, cab
bac are acceptable, but aac or bcd are unacceptable. | Microsoft | 5 |
| main()
{
char *p;
printf("%d %d ",sizeof(*p),sizeof(p));
} | | 1 |
| |
| For more C Code Interview Questions Click Here |