C lovers
C interview questions and answers
C program examples
Data type questions
Variable naming rule questions
Operators questions
Control flow questions
Switch case questions
Looping questions
Pointer questions
More pointer questions
Array questions
String questions
Function questions
Printf,Scanf questions
Preprocessor questions
Friday, September 25, 2009
Wednesday, September 16, 2009
c interview questions
COMMONLY ASKED QUESTIONS IN INTERVIEW
1. In the following declaration statement
char c=�A�;
Variable c stores one byte of memory space while character constants �A� stores one byte memory space. How one byte variables can stores two byte character constant?
2. What is automatic type promotion in c?
3. Swap two variables without using third variable.
4. Write a c program
Saturday, September 12, 2009
What is function in C programming?
Definition of function:
Function is block or part of program. When any program is very long or same code is repeating many times then we try to cut the program in different parts (or blocks) so that whole program became more understandable, easier to debug (error checking) and size of code will be lesser.
Syntax of function in c programming
Simple example of function
Function is block or part of program. When any program is very long or same code is repeating many times then we try to cut the program in different parts (or blocks) so that whole program became more understandable, easier to debug (error checking) and size of code will be lesser.
Syntax of function in c programming
Simple example of function
Friday, September 11, 2009
Mock test of c programming with answer
Mock test of c
programming with answer
1. Point out error, if any, in the
following program
int main(){
int i=1;
switch(i){
case 1:
printf("\nRadioactive cats have 18
half-lives");
break;
case 1*2+4:
printf("\nBottle for rent -inquire
within");
break;
}
}
Answer: No error.
Constant expression like
1*2+4 is acceptable in cases of a switch.
2. Point out the
error, if any
programming with answer
1. Point out error, if any, in the
following program
int main(){
int i=1;
switch(i){
case 1:
printf("\nRadioactive cats have 18
half-lives");
break;
case 1*2+4:
printf("\nBottle for rent -inquire
within");
break;
}
}
Answer: No error.
Constant expression like
1*2+4 is acceptable in cases of a switch.
2. Point out the
error, if any
Placement questions of C
question of c programming with solution1. Point out error, if any, in the following programmain(){int i=1;switch(i){case 1:printf("\nRadioactivecats have 18 half-lives");break;case 1*2+4:printf("\nBottle forrent -inquire within");break;}}Ans. Noerror. Constant expression like 1*2+4 are acceptablein cases of a switch.2. Point out the error, if any, in the following programmain(){int a=10,b;a>= 5
C placement paper
C new placement papers questions and answers. It is model or sample test questions and answers in c programming language
(1) What will be output of the following program ?
void main()
{ int i;
clrscr();
printf("india"-'A'+'B');
getch();
}
(2)What will be output of the following program ?
void main()
void main()
{ int i;
clrscr();
printf(5+"Raja hindustani");
getch();
}
c programming interview question with solution
(1)void main(){int i='-'-'-';int a;clrscr();a=sizeof(i++,++i,1.1);printf(" a= %d i= %d",a,i);getch();}output : a=0 a=8(2)void main(){unsigned int i=-1;int j=-1;float b,c;clrscr();b=i+5.5;c=j+5.5;printf("%.0f %.0e\n",b,c);printf("%u\n",i*-1);printf("%u\n",-i*-1);getch();}output: 65540 4e+00165535(3)void main(){unsigned char a=-13;int b;clrscr();b=~(a^a);printf("%x %X\n",b);getch();}output:ffff
Subscribe to:
Posts (Atom)