Datatypes Basic life operations Branching statements
Looping statements Storage classes Key library functions
Memory management Command line parameters Pre processor statements.
1. Observe the following code and write the name(s) of the header file(s), which will be essentially required to run it.
void main() {
float Area,Side;
Scanf(“%f”,&Area);
Side = sqrt (Area):
Printf(“%0.2f”,Side);
}
a. conio.h
b. math.h
c. string.h
d.stdlib.h
Ans:
b. math.h
2. What is the output of the following code. (* Question)
void main() {
float f=0.1;
if (f==0.1)
Printf(“Yes”);
else
Printf(“No”);
}
a. Yes b. No c. Compiler error d. Runtime eroor
Ans:
b. No
3.
What of the following is not fundamantal datatype in c language.
a. Int b. float c. char d. enum
Ans:
d.Enum
4. Which of the following functions is not in string.h
a. strptr() b. strstr() c. strlen() d. strcmp()
Ans:
a. strptr()
5. The function atoi is used to
a.Converts long integer to string
b.Converts string to long integer
c.Converts integer to string
d.Converts string to integer
Ans:
d. Converts string to integer
6. Which of the following are correct with respect to argc and argv in command line arguments.
a. Default parameters in every main function.
b. Argc holds the arguments and argv counts the number of arguments in command line
arguments.
c. Argc holds the count of arguments and argv holdss the arguments in command line arguments.
d. Argc and argv both represents same in command line arguments.
Ans:
C.
7. What is the output of the following code.
#include<stdio.h>
int main() {
r=foo();
printf("%d",r); }
int foo( ) {
static int r=1;
r++;
return r; }
a.2. b. 0. c. Garbage Value. d.Undeclared r in function main( ).
Ans:
d.
8. Which of the following is used to locate the end of the file
a. fseek ( )
b. feof ( )
c. eof( )
d. ftell ( )
Ans:
b. feof( )
9. Which of the following correct with function ftell ( ).
a.returns the value of the current pointer position in the file
b.It is used for seeking the pointer position in the file at the specified byte.
c.It rewinds the file
d. It returns the name of the file which was successfully opened.
Ans:
a. returns the value of the current pointer position in the file