| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| what is difference between ++(*p) and (*p)++ | Accenture | 15 |
| which of the following go out of the loopo if expn 2
becoming false
a.while(expn 1){...if(expn 2)continue;}
b.while(!expn 1){if(expn 2)continue;...}
c.do{..if(expn 1)continue;..}while(expn 2);
d.while(!expn 2){if(expn 1)continue;..}
| TCS | 2 |
| main()
{
clrscr();
}
clrscr();
| ME | 3 |
| Why does not use getgh(); and <conio.h> in c language. | Elofic | 2 |
| write a program in 'c' to find the value of p[i+1]^n.p,i,n
are arguments of a macro and n is a integer | | 1 |
| consider the following structure:
struct num nam{
int no;
char name[25];
};
struct num nam
n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};
.....
.....
printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1);
What does the above statement print?
a.8,9
b.9,9
c.8,8
d.8,unpredictable value
| TCS | 3 |
| 24.what is a void pointer?
25.why arithmetic operation can’t be performed on a void
pointer?
26.differentiate between const char *a; char *const a;
and char const *a;
27.compare array with pointer?
28.what is a NULL pointer?
29.what does ‘segmentation violation’ mean?
30.what does ‘Bus Error’ mean?
31.Define function pointers?
32.How do you initialize function pointers? Give an example?
33.where can function pointers be used? | | 1 |
| pointer_variable=(typecasting
datatype*)malloc(sizeof(datatype));
This is the syntax for malloc?Please explain this,how it
work with an example? | Excel | 2 |
| write an algorithm to get a sentence and reverse it in the
following format:
input : I am here
opuput: Here Am I
note: first letter of every word is capiatlised | | 2 |
| const char *
char * const
What is the differnce between the above tow?.
| TCS | 5 |
| What's wrong with the call "fopen ("c:\newdir\file.dat", "r")"? | | 1 |
| How to Clear last bit if it 1 using Macro TURN_OFF_BIT_LAST | Adobe | 2 |
| difference between i++* and *++i | IBM | 3 |
| Write a program to give following output.....
*********
**** ****
*** ***
** **
* *
** **
*** ***
**** ****
********* | | 2 |
| read the folllowing code
# define MAX 100
# define MIN 100
....
....
if(x>MAX)
x=1;
else if(x<MIN)
x=-1;
x=50;
if the initial value of x=200,what is the vlaue after
executing this code?
a.200
b.1
c.-1
d.50
| TCS | 2 |
| hi how to convert program from notepad to turboc editor can
u please help me | | 1 |
| fn f(x)
{ if(x<=0)
return;
else f(x-1)+x;
}
| HCL | 3 |
| An interactive c program to read basic salary of 15
persons. each person gets 25% of basic as HRA, 15%of basic
as conveyance allowances, 10%of basic as entertainment
allowances.The total salary is calculated by adding
basic+HRA+CA+EA.Calculate how many out of 15 get salary
above 10,000.Rs also print the salary of each employee | | 2 |
| why you will give me a job in TCS. | TCS | 5 |
| c programming of binary addition of two binary numbers
| | 1 |
| |
| For more C Interview Questions Click Here |