C Technical Test – 8 | C Language Online Test

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


1. What is the Output of following Code?
int main(void)
{
int i = 20;
int j = 20;
int k = 20;
printf(“%d%o%x”, i, j,k );
return 0;
}

 
 
 
 

2. What is the Output of following Code?
#include<stdio.h>
main()
{
int x=5 , y=3;
x++ ? –y : ++x ;
printf(“%d,%d”,–x , –y);
}

 
 
 
 

3. What will be the output of following code?
#include<stdio.h>
int main()
{
int i=1;
while(i++);
printf(“%d”,i);
return 1;
}

 
 
 
 

4. What is the output of following code?
#include <stdio.h>
void f1()
{
static int s=5;
++s;
printf(“%d”,s);
}
void main(){
f1();
f1();
printf(“%d”,s);
}

 
 
 
 

5. What is the output of following C program?
#include<stdio.h>
int main()
{
int a[][4]={{10,20,30},{1,2,3,4},{5,6},{7}};
printf(“%d %d %d”,sizeof(a),a[0][2],a[1][2]);
}

 
 
 
 

6. What is the Output of following Code?
#include<stdio.h>
void main()
{
char s[ ] = “HamaM”;
s[2]<s[strlen(s)-1] ? printf(“Yes”) : printf(“No”);
}

 
 
 
 

7. What is “ptr” in the below declaration?
int (*ptr) [4]

 
 
 
 

8. Which of the following Statement about Union is false?

 
 
 
 

9. What is the Output of following Code?
#include <stdio.h>
void main()
{
const int x=5;
const int *ptrx;
ptrx = &x;
*ptrx = 10;
printf(“%d\n”, x);
return 0;
}

 
 
 
 

10. How many bytes the address increases?
#include <stdio.h>
int x = 0;
void main()
{
int *ptr = &x;
printf(“%p\n”, ptr);
x++;
printf(“%p\n “, ptr);
}

 
 
 
 

Question 1 of 10

 

Share this