'C' Programming Language Online Test

printf (“%d”, printf (“tim”));


Output of the following program fragment is

x = 5;

y = x++;

printf(“%d%d”, x, y);


Consider the following program

main ( )

{ float a = 0.5, b = 0.7;

if (b < 0.8)

if (a < 0.5)

printf (“ABCD”);

else

printf (“PQR”);

else

printf (“JKLF);

}

The output is


The following program fragment

int *a;

*a = 7;


A pointer variable can be


‘C’ is often called a


The loop in which the statements within the loop are executed at least once is called


The control automatically passes to the first statement after the loop in


A self contained block of statements that perform a coherent task of some kind is called a


Recursion is sometimes called


Each C preprocessor directive begins with


main()

{

long i = 30000;

printf(“%d”, i);

}

the output is


The directive that can be used to test whether an expression evaluates to a nonzero value or not is


main()

{

printf(“%p\n”, main());

}


The << operator is used for


The C language includes the header file standard input & output in


The value that follows the keyword CASE may only be


The statement which is used to terminate the control from the loop is


Set of values of the same type, which have a single name followed by an index is called


An array of pointers is same as


What is the output of the following program segment?

main()

{

long i = 65536;

printf(“%d\n”, i);

}


What is the output of the following program segment?

main()

{

int i = 1;

do

{

printf(“%d..”, i);

} while(i--);

}


What is the output of the following program segment?

main()

{

int i = ++2;

printf(“%d\n”, i);

}


The name of all functions end with a


scanf() can be used for reading


The statement that transfers control to the beginning of the loop is called


A variable which is visible only in the function in which it is defined, is called


Output of the program given below is

int i;

main()

{

printf(“%d”, i);

}


What will be the output of the following program?

main()

{

char *p = “ayqm”;

printf (“%c”, ++*(p++));

}


What will be the output of the following program?

main()

{

int i = 5;

printf(“%d”, i=++i==6);

}


The maximum value that an integer constant can have is


What will be the output of following program?

main()

{

int x=15;

printf(“\n%d%d%d”, x!=15, x=20, x<30);

}


How many times the following program would print (“abc”)?

main()

{

printf(“\nabc”);

main();

}


What would be output of the following program?

#include "stdio.h"

main()

{

printf(“%d%d”, size of (NULL!), size of (“ “));

}


What would be output of the following program, if the array begins at 65486?

main()

{

int arr[ ] = {12, 14, 15, 23, 45};

printf(“%u%u”, arr+1, &arr+1);

}


If a = 5 and b = 7 then the statement p = (a > b) : a ? b


If an integer occupies 4 bytes and a character occupies 1 bytes of memory, each element of the

following structure would occupy how many bytes?

struct name

{

int age;

char name [20];

}


What will happen if the following loop is executed?

int num = 0;

do

{

--num;

printf(“%d”, num);

num++;

} while (num >= 0);

}


The break statement causes an exit


It is necessary to declare the type of function in the calling program if


The function fprintf is used in a program


C language was invented by


The given FOR loop is

for ( ; ; )

{

printf(“ ”);

}


The following code displays

main( )

{

int *p;

p = (int*) malloc(sizeof(int));

*p = 10;

printf(“p = %d\n”, *p);

}


The output of the following will be

for (x=1, y=5; x+y<=10; x++)

{

printf(“%d%d”, x,y);

y++;

}


The __________ statement causes immediate exit from the loop overriding the condition test


The output of the following code is

a = 5;

a << 1;

printf(“%d”, a);


The operators << and >> are


What will be the output of the following program

main( )

{

int k, num=30;

k=(num>5 ? (num<= 10 ? 100:200):500);

printf(“\n%d”, num);

}


What is the output of the following code

int n = 0, m=1;

do

{

printf(“%d”, m);

m++;

}

while(m<=n);


If a=8 and b=15 then the statement

x= (a>b) ? a:b;


What is the output of the following code

int n=0, m;

for (m=1; m<=n+1; m++)

printf(“%d”, m);


How many times the following loop be executed

{

ch = ‘b’;

while(ch >= ‘a’ && ch <= ‘z’)

ch++;


Which of the following is FALSE in C


int **ptr; is


What will be output if you will compile and execute the following c code?

#include<stdio.h>

int main()

{

int i=320;

char *ptr=(char *)&i;

printf("%d",*ptr);

return 0;

}


What will be output if you will compile and execute the following c code?

#include<stdio.h>

#define x 5+2

int main()

{

int i;

i=x*x*x;

printf("%d",i);

return 0;

}


What will be output if you will compile and execute the following c code?

#include<stdio.h>

int main()

{

char c=125;

c=c+10;

printf("%d",c);

return 0;

}


What will be output if you will compile and execute the following c code?

#include<stdio.h>

int main()

{

int a=10;

printf("%d %d %d",a,a++,++a);

return 0;

}


What will be output if you will compile and execute the following c code?

#include<stdio.h>

int main()

{

char *str="Hello world";

printf("%d",printf("%s",str));

return 0;

}




























































































































































































































































Description:

Test your knowledge on 'C' Programming Language .

This Test covers on these topics: Constants,Variables,Data types,Operators,Expression,Data input and output,Control statements,Functions,Arrays,Strings,Structures,Unions,
Pointers,Files.

Test consists of 60 Multiple choice questions.

Each question carries 1 mark.

There is No Negative marking.

Test Duration is 1 hour.

Wish You all the best

Discussion

Snehal

I guess getting 9 is good score in this test. shitty answers all answers are right still showing wrong

1525 days 14 hours ago

Reshmani

Hi
I wrote the above test,those are really good questions, some of my answers are correct but it is showing wrong, pls let me know the correct answer explanation.
thanks

1949 days 11 hours 7 minutes ago

Tan vir

Nice Questions

2167 days 19 hours 16 minutes ago

Satishkumar D
Sr Assistant professor - Electrical & Electronics Engineering
17 Members Recommend
37 Followers

Your Facebook Friends on WizIQ

More Tests By Author

Quantitative Aptitude Online test
60 Questions | 527 Attempts

Quantitative Aptitude Online test
60 Questions | 386 Attempts

Basic Electronics Online Test
60 Questions | 5962 Attempts