C Technical Test – 9

This “C Technical Test” is providing set of technical and logical questions to test your C programming skills.


1. What is the Output of following Code?
#include<stdio.h>
void main()
{
signed short s = 32770 ;
printf(“%d”,s);
}

 
 
 
 

2. What is the Output of following Code?
#include<stdio.h>
main()
{
int a=5,b=3,c=7,d=5,e,f ;
e = a++ != d–;
f = ++b == d++;
printf(“%d,%d”, b,e);
}

 
 
 
 

3. How many ways can we use ‘&’ operator?

 
 
 
 

4. What will be the output of following code?
#include<stdio.h>
int main()
{
if(1)
printf(“Hi\n”);
printf(“Welcome\n”);
else
printf(“Hello\n”);
return 0;
}

 
 
 
 

5. What will be the output of following code?
#include<stdio.h>
main()
{
int a=3;
while(a++ <= 10)
{
printf(“a : %d\n” , a+3);
++a ;
}
}

 
 
 
 

6. What is the output of following code?
#include <stdio.h>
void main()
{
int x = 3;
x++;
if (x <= 5)
{
printf(“hi\n”);
main();
}
}

 
 
 
 

7. What is the output of following code?
#include<stdio.h>
void main ()
{
int x[5] = {9, 4, 7 , 6, 4};
int i, sum=0;
for(i=0 ; i<5 ; i++)
{
x[i] = x[i]+i;
}
for(i=1 ; i<4 ; i++)
{
sum += x[i];
}
printf(“Sum : %d\n”, sum);
}

 
 
 
 

8. How can we increase the size of array dynamically?

 
 
 
 

9. What is the Output of following Code?
#include<stdio.h>
int main()
{
char *p=”CBOOK”;
printf (“%c\t”, *(++p));
p -=1;
printf (“%c\t”, *(p++));
return 0;
}

 
 
 
 

10. What are the arguments of fopen() are

 
 
 
 

Question 1 of 10

 

Share this