C Technical Test – 5 | C Language Online Test

This “C Technical Test” is providing set of technical and objective type questions to test your skills in C programming language.


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

 
 
 
 

2. Which data type holds only homogeneous elements?

 
 
 
 

3. What is the Output of following Code?
#include<stdio.h>
int main()
{
int i=1;
i=2+2*i++;
printf(“%d”,i);
return 0;
}

 
 
 
 

4. What will be the output of following code?
#include<stdio.h>
int main()
{
signed char ch = 125;
while(ch++>0)
{
printf(“%d\n”,++ch);
}
return 0;
}

 
 
 
 

5. Which of the following do we use as a condition in while loop?

 
 
 
 
 

6. Find the output of following program
#include<stdio.h>
void fun(int, int);
void main()
{
int i=3;
fun(i , i++);
printf(“%d\n”,i);
}
void fun(int i, int j)
{
printf(“%d\n”,i++);
printf(“%d\n”,j–);
}

 
 
 
 

7. What is the output of following C program?
#include<stdio.h>
int main()
{
int a = 0, b = 1, c = 2;
int array[3] = {a, b, c};
printf(“%d \n”, array[1]);
return 0 ;
}

 
 
 
 

8. What is the output of following C program?
#include<stdio.h>
int main()
{
short num[3][2]={3,6,9,12,15,18};
printf(“%d %d”,*(num+1)[1],**(num+2));
return 0;
}

 
 
 
 

9. What is the output of this C code?
#include<stdio.h>
int main()
{
int i = 100;
int *ip1, *ip2;
ip1 = &i;
ip2 = ++ip1;
–ip1;
printf(“diff : %u\n”, ip2-ip1);
return 0;
}

 
 
 
 

10. What is the Output of following Code?
#include <stdio.h>
void main()
{
auto int a=2;
{
auto int b=3;
printf(“%d,%d,”,a,b);
}
printf(“%d”,a);
}

 
 
 
 

Question 1 of 10

 

 

Share this