C Technical Test – 6 | C Language Online Test

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


1. How can we store a character or symbol into 1-byte memory?

 
 
 
 

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

 
 
 
 

3. What will be the output of following code?
#include<stdio.h>
int main(){
int x=2,y=3;
if(x< x++||y< y++)
printf(“%d %d”,x,y);
else
printf(“else block”);
return 1;
}

 
 
 
 

4. Find the output of following program
#include<stdio.h>
void f(int, int);
void main()
{
int i=10;
f(i, i++);
printf(“%d\n”,i);
}
void f(int i, int j)
{
if(i>40)
return;
i+=j;
f(i,j);
printf(“%d\n”,i);
}

 
 
 
 

5. What is the output of following code?
#include <stdio.h>
#include <math.h>
int main()
{
double n=2.8 ;
printf(“%.3lf\n” , floor(n));
return 0;
}

 
 
 
 

6. What is the output of following C program?
#include <stdio.h>
int main()
{
int a[4] = {10, 20, 30, 40};
printf(“%d\n”, *(a+2)+1);
return 1;
}

 
 
 
 

7. What is the Output of following Code?
#include<stdio.h>
void main()
{
char *x=”HELLO”;
x+=2;
printf(“%s”,x++);
}

 
 
 
 

8. What is the Output of following Code?
#include <stdio.h>
int main()
{
struct sample
{
int a ;
int b ;
struct sample *s;
}t;
printf(“%d,%d”,sizeof(struct sample),sizeof(t.s));
return 0;
}

 
 
 
 

9. What is the output of this C code?
#include<stdio.h>
void main()
{
int i=100;
int* ptr = &i;
printf(“%d\n”,*ptr);
printf(“%d\n”,*(*(&ptr)));
}

 
 
 
 

10. FILE* which is pointing to a text file is of ______?

 
 
 
 

Question 1 of 10

 

 

Share this