| Other C Code Interview Questions |
| |
| Question |
Asked @ |
Answers |
| |
| code of a program in c language that ask a number and print
its decremented and incremented number..
sample output:
input number : 3
321123 |
HCL | 1 |
| Is the following code legal?
typedef struct a aType;
struct a
{
int x;
aType *b;
}; |
| 1 |
| What is the output of the program given below
main()
{
signed char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
} |
| 1 |
| Write a program to check whether the number is prime and also
check if it there i n fibonacci series, then return true
otherwise return false |
lenovo | 1 |
| main()
{
int (*functable[2])(char *format, ...) ={printf, scanf};
int i = 100;
(*functable[0])("%d", i);
(*functable[1])("%d", i);
(*functable[1])("%d", i);
(*functable[0])("%d", &i);
}
a. 100, Runtime error.
b. 100, Random number, Random number, Random number.
c. Compile error
d. 100, Random number |
HCL | 1 |
| Code for 1>"ascii to string"
2>"string to ascii" |
Global-Logic | 1 |
| Finding a number which was log of base 2 |
NetApp | 1 |
| main()
{
int i=300;
char *ptr = &i;
*++ptr=2;
printf("%d",i);
} |
CSC | 3 |
| func(a,b)
int a,b;
{
return( a= (a==b) );
}
main()
{
int process(),func();
printf("The value of process is %d !\n
",process(func,3,6));
}
process(pf,val1,val2)
int (*pf) ();
int val1,val2;
{
return((*pf) (val1,val2));
} |
Satyam | 1 |
| enum colors {BLACK,BLUE,GREEN}
main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
} |
| 2 |
| Print an integer using only putchar. Try doing it without
using extra storage. |
| 2 |
| main()
{
{
unsigned int bit=256;
printf("%d", bit);
}
{
unsigned int bit=512;
printf("%d", bit);
}
}
a. 256, 256
b. 512, 512
c. 256, 512
d. Compile error |
HCL | 1 |
| |
| For more C Code Interview Questions Click Here |
|