C Technical Test – 2 | C Language Online Test

This page is providing a technical question to test your C programming skills.


1. Variables inside the parenthesis of functions declarations have _____ level access.

 
 
 
 

2. What is the output of following code?
#include<stdio.h>
void fun(int);
void main()
{
int x=2;
fun(x++);
}
void fun(int x)
{
printf(“x value : %d\n”,x++);
}

 
 
 
 

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

 
 
 
 

4. 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 ;
}

 
 
 
 

5. Find the output of following program
#include <stdio.h>
#include <conio.h>
void main()
{
while (!kbhit())
printf(“Hello.\n”);
return 0;
}

 
 
 
 

6. The elements in the array of the following code are int array[5] = {5};

 
 
 
 

7. 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;
}

 
 
 
 

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

 
 
 
 

9. 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);
}

 
 
 
 

10. What is the Output of following Code?
void main()
{
char str[] = “Java\02Python”;
printf(“%s”, str);
}

 
 
 
 

Question 1 of 10

 

Share this