| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| main()
{
printf("%x",-1<<4);
} | | 1 |
| main()
{
41printf("%p",main);
}8 | | 1 |
| main()
{
int c=- -2;
printf("c=%d",c);
} | | 1 |
| How we will connect multiple client ? (without using
fork,thread) | TelDNA | 2 |
| void main()
{
char ch;
for(ch=0;ch<=127;ch++)
printf(“%c %d \n“, ch, ch);
} | | 1 |
| Program to Delete an element from a doubly linked list.
| Infosys | 4 |
| How to swap two variables, without using third variable ? | HCL | 47 |
| How will you print % character?
a. printf(“\%”)
b. printf(“\\%”)
c. printf(“%%”)
d. printf(“\%%”) | HCL | 1 |
| main()
{
float i=1.5;
switch(i)
{
case 1: printf("1");
case 2: printf("2");
default : printf("0");
}
} | | 1 |
| #include <stdio.h>
#define a 10
main()
{
#define a 50
printf("%d",a);
} | | 1 |
| Write, efficient code for extracting unique elements from
a sorted list of array.
e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).
| Microsoft | 10 |
| main()
{
int a=10,*j;
void *k;
j=k=&a;
j++;
k++;
printf("\n %u %u ",j,k);
} | | 1 |
| String copy logic in one line. | NetApp | 9 |
| why java is platform independent? | Wipro | 10 |
| Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2)
without making use of any floating point computations at all. | Microsoft | 2 |
| #include<stdio.h>
main()
{
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
};
struct yy *q;
};
} | | 1 |
| What are the files which are automatically opened when a C
file is executed? | | 1 |
| void main()
{
int i;
char a[]="\0";
if(printf("%s\n",a))
printf("Ok here \n");
else
printf("Forget it\n");
} | | 1 |
| enum colors {BLACK,BLUE,GREEN}
main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
} | | 1 |
| main()
{
int i, n;
char *x = “girl”;
n = strlen(x);
*x = x[n];
for(i=0; i<n; ++i)
{
printf(“%s\n”,x);
x++;
}
} | | 1 |
| |
| For more C Code Interview Questions Click Here |