WizIQ helps you learn and teach online - any subject you can think of!
Join for FREE

C Language, Programming Language from Dennis Ritchie and Bell Labs online Test

In the following code in which order the functions would be called? a=f1 (23,14)*f2(12/4)+f3();
f3,f2,f1
The order may vary from compiler to compiler
f1,f2,f3
None of the above
Can I increase the size of a dynamically allocated array?
True
False
A near pointer uses the contents of CS register (if the pointer is pointing to code) or contents of DS register (if the pointer is pointing to data) for the segment part, whereas the offset part is stored in the 16-bit near pointer
True
False
char * abc [] = { "Sleepy", "Dopey" "Doc", "Happy", "Grumpy" "Sneezy", "Bashful", }; How many elements does the array abc (declared above) contain? Assume the C compiler employed strictly complies with the requirements of Standard C. 
4
5
6
7
8
What would be the output of the following program ? const int x = 5 ; const int *ptrx ; ptrx = &x ; *ptrx =10 ; printf ( "%d”, x) ;
5
10
Error
Garbage Value
What will the following program output? main (int argc, char *argv[ ], char *env[ ] ) { int i; for (i=1; I < argc ; i++) printf ( "%s ", env[i] ) }
Error
List of all environment variables
NULL
List of all command line arguments.
double x = -3.5, y = 3.5; printf( "%.0f : %.0f\n", ceil( x ), ceil( y ) ); printf( "%.0f : %.0f\n", floor( x ), floor( y ) ); What will the code above print when executed? ceil =>rounds up 3.2=4 floor =>rounds down 3.2=3 
-4 : 3  -3 : 4 
-3 : 3  -4 : 4 
-3 : 4  -4 : 3
-4 : 4  -3 : 3 
-4 : 3  -4 : 3 
Can I increase the size of a statically allocated array?
True
False
What would be the output of the following program? main( ) { int i = 32, j = 0x20, k, l , m ; k = i | j ; l = i & j; m=k ^ l; printf ("%d %d %d %d %d", i, j, k, l , m) ; }
032323232
32 32 32 32 32
32 32 32 32 0
0 0 0 0 0
int x[] = {1, 2, 3, 4, 5}; int u; int *ptr = x; ???? for( u = 0; u < 5; u++ ) { printf("%d-", x[u]); } printf( "\n" ); Which one of the following statements could replace the???? in the code above to cause the string 1-2-3-10-5- to be printed when the code is executed? 
*(ptr[ 3 ]) = 10; 
*ptr[ 3 ] = 10; 
(*ptr)[ 3 ] = 10; 
*ptr + 3 = 10; 
*(ptr + 3) = 10; 
If the following program (myprog) is run from the command line as myprog 1 2 3 what would be the output? main ( int argc, char *argv[ ] ) { int i ; i = argv[1] + argv[2] + argv[3] ; printf( "%d", i) ; }
Error
6
123
“123”
A file written in text mode can be read back in binary mode
True
False
The macro va_arg is used to extract an argument from the variable argument list and advance the pointer to the next argument..
True
False
typedefs have the advantage that obey scope rules, that is, they can be declared local to a function or a block whereas #defines always have a global effect.
True
False
If the. following program (myprog) is run from the command line as myprog friday tuesday Sunday What would be the output? main ( int sizeofargv, char *argv[ ] ) { while (sizeofargv ) printf ( “%s”, argv(--sizeofargv]) ;
myprog friday tuesday saturday
myprog friday tuesday
sunday tuesday friday myprog
sunday tuesday Friday
Description:

This is another short test on C Language to help out the students of Programming Language
Disclaimer: Content, such as images used in the questions (if any), have been picked up from various places for the sole purpose of Instruction.

Comments
K F
By: K F
749 days 10 hours 23 minutes ago

Question 6 has two typos in it. 1) Capital 'I' instead of 'i' in for-loop 2) No semi-colon at end of printf

PazzaC
By: PazzaC
713 days 7 hours 37 minutes ago

Question 10 has the wrong answer!!! It's the last option: *(ptr 3) = 10; and NOT the first option: *(ptr[3]) = 10; In fact, the first option is erroneous because the sqaure-braces denote the effective dereferencing of the array address to an individual array item (of type 'int') and so cannot be explicitly dereferenced using the '*'.

Rajeev Debnath
By: Rajeev Debnath
693 days 20 hours 27 minutes ago

Regarding question no. 10: *(ptr 3)=10 is right answer.

shyam kumar
By: shyam kumar
640 days 22 hours 45 minutes ago

regarding ques 10 the ans is last option *(ptr 3)

saveki
By: saveki
639 days 19 hours 54 minutes ago

answers

gagan
By: gagan
563 days 14 hours 23 minutes ago

ooooooooooooo

karthick
By: karthick
557 days 16 hours 44 minutes ago

interesting

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no.:


Area code Number
Subject you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy

Your Facebook Friends on WizIQ

More Tests By Author

ASP Server Controls
10 Questions | 227 Attempts

ASP.NET, Namespaces ASP.NET
10 Questions | 855 Attempts

An ASP.NET Application
10 Questions | 173 Attempts

Test your basic knowledge on DATASTRUCTURES, STACK
10 Questions | 410 Attempts