| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| what will be the result of the following program ?
char *gxxx()
{
static char xxx[1024];
return xxx;
}
main()
{
char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is :
%s",gxxx());
}
a) The string is : string
b) The string is :Oldstring
c) Run time error/Core dump
d) Syntax error during compilation
e) None of these
| IBM | 2 |
| How to access or modify the const variable in c ? | HP | 3 |
| There are 3 baskets of fruits with worng lables,one basket
has apple,another basket has orange,another has combination
of apple and orange,what is the least way of interchange
the lables. | Google | 8 |
| How can I read a directory in a C program? | | 1 |
| How can I convert integers to binary or hexadecimal? | | 2 |
| Write an implementation of “float stringToFloat(char *str).”
The code should be simple, and not require more than the
basic operators (if, for, math operators, etc.).
• Assumptions
• Don’t worry about overflow or underflow
• Stop at the 1st invalid character and return the number
you have converted till then, if the 1st character is
invalid return 0
• Don’t worry about exponential (e.g. 1e10), instead you
should treat ‘e’ as an invalid character
• Write it like real code, e.g. do error checking
• Go though the string only once
• Examples
• “1.23” should return 1.23
• “1a” should return 1
• “a”should return 0
| Qualcomm | 2 |
| what is the different between if-else and switch statment
(other than syntax) | CTS | 9 |
| What is difference between the following 2 lines….
int temp = (int)(0x00);
int temp = (0x00int);
| Bosch | 3 |
| Design a program using an array that searches a number if it
is found on the list of the given input numbers and locate
its exact location in the list. | | 3 |
| what does data structure mean? | | 7 |
| how does the for loop work actually..suppose for the
following program how it ll work plz explain to me
for(i=5;i>=0;i--)
prinf(i--); | RMSI | 13 |
| write a program to generate 1st n fibonacci prime number | | 4 |
| can anyone please tell me wat is backlogs... i was looking
for the job openings where i read this.. eligibility
criteria minimum 70% in degree without backlogs. is that
arrear.. if so is it standing arrear or history of
arrears... please help me... | | 2 |
| what is the function of void main()? | | 4 |
| How do I access command-line arguments? | Wipro | 2 |
| Please list all the unary and binary operators in C. | | 1 |
| Add 2 64 bit numbers on a 32 bit machine | NetApp | 1 |
| what is the difference between const volatile int i
& volatile const int j; | HCL | 1 |
| write a C code
to reverse a string using a recursive function, without
swapping or using an extra memory.
| Motorola | 2 |
| can you explain in brief what is "r+" mode in a file... i
know that it si used to read and modify rhe existing
content.... but explalanation about the file pointer in "r+"
mode i wann to know??????????? | Cognizent | 1 |
| |
| For more C Interview Questions Click Here |