| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What is the result
main()
{
char c=-64;
int i=-32
unsigned int u =-16;
if(c>i){
printf("pass1,");
if(c<u)
printf("pass2");
else
printf("Fail2");}
else
printf("Fail1);
if(i<u)
printf("pass2");
else
printf("Fail2")
}
a)Pass1,Pass2
b)Pass1,Fail2
c)Fail1,Pass2
d)Fail1,Fail2
e)none
| IBM | 7 |
| Which of the following is not an infinite loop ?
a.while(1){
....
}
b.for(;;){
...
}
c.x=0;
do{
/*x unaltered within theloop*/
...
}while(x==0);
d.# define TRUE 0
...
while(TRUE){
....
}
| TCS | 4 |
| what is the difference between arrays and linked list | Tech-Mahindra | 15 |
| what is the hexidecimal number of 4100? | Google | 14 |
| what is the use of pointers | | 5 |
| Difference between Class and Struct.
| Motorola | 6 |
| write a 'c' program to sum the number of integer values | | 5 |
| Given a single Linked list with lakhs of nodes and length
unknown how do you optimally delete the nth element from the
list? | Oracle | 1 |
| Which of the following about the C comments is incorrect ?
a.commentscan go over multiple lines
b.comments can start any where in the line
c.a line can contain comments with out any language statements
d.comments can occur within comments
| TCS | 6 |
| Switch (i)
i=1;
case 1
i++;
case 2
++i;
break;
case 3
--i;
Output of i after executing the program
| Mascot | 4 |
| plssssss help !!....using array.. turbo c..
create a program that will accept number of words to be
consored.
.a word must not exceed 10 characters long
.the text to be entered will be no longer than 200 characters
.there will be no 10 words
example:
enter number of words to be censor: 5
enter words to censor:
windows
office
microsoft
bill
gates
enter text to censor:
bill gates founded microsoft and makes office and windows
sample output:
<consored> <censored> founded <censored> and makes
<censored> and <censored> | | 1 |
| enum colors {BLACK,BLUE,GREEN}
main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
}
| ME | 3 |
| 34.what are bitwise shift operators?
35.what are bit fields? What is the use of bit fields in a
structure declaration?
36.what is the size of an integer variable?
37.what are the files which are automatically opened when a
c file is executed?
38.what is the little endian and big endian?
39.what is the use of fflush() function?
40.what is the difference between exit() and _exit() functions?
41.where does malloc() function get the memory?
42.what is the difference between malloc() and calloc()
function?
43.what is the difference between postfix and prefix unary
increment operators? | | 2 |
| What is sparse file? | | 1 |
| 5. distance conversion:
Convert a distance from miles to kilometers .there are 5280
feets per mile,12 inches per foot .2.54 centimeters per
inch and 100000centimeters per kilometer
| | 1 |
| what is memory leak?
| | 3 |
| Is reference used in C? | | 1 |
| what is the difference between NULL & NUL keywords in C? | | 3 |
| how many header file is in C language ? | | 14 |
| what is a c-language.what is do. | HCL | 3 |
| |
| For more C Interview Questions Click Here |