SCDL – 3rd Semester – C - Programming
Select The Blank LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Question The arguments that we pass on to main() at the command prompt are called
________ arguments.
Correct Answer command line
Your Answer command line
Select The Blank
Question ________ function is used to append one string at the end of another
Correct Answer strcat
Your Answer strcat
True/False
Question strrchr() find first occurrence of a given character in a string.
Correct Answer False
Your Answer False
True/False
Question The sequence diagram shows flow of behaviour and collaboration of objects.
Correct Answer False
Your Answer False
Select The Blank
Question A structure ________ copied to another structure of same type by simply assigning
using '=' operator.
Correct Answer can be
Your Answer can be
Multiple Choice Single Answer
Question Two statements are written within if block without any braces, if condition is true it
will :-
Correct Answer execute the first statement in the block and the 2nd will get executed irrespictive of
the condition is true or false
Your Answer execute the first statement in the block and the 2nd will get executed irrespictive of
the condition is true or false
Multiple Choice Single Answer
Question What will be the output? main ( ) { int x = 3 ; float y = 3.0 ; if ( x == y ) printf ( "\nx
and y are equal") ; else printf ( "\nx and y are not equal ) ; }
Correct Answer x and y are equal
Your Answer x and y are equal
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Page 1 of 62
SCDL – 3rd Semester – C - Programming
True/False
Question A function can return only one value at a time.
Correct Answer True
Your Answer True
Select The Blank
Question ________ function appends first n characters of a string at the end of another
Correct Answer strncat
Your Answer strncat
Multiple Choice Multiple Answer
Question What will be the output? main( ) { int a[10]={10,20,30},i=0; printf("%d",a[i]++);
printf("%d",a[i]); }
Correct Answer 10 , 11
Your Answer 10 , 11
Multiple Choice Multiple Answer
Question Which of the following operators have not 3rd priority in operations?
Correct Answer +,*,%
Your Answer +,*,%
Multiple Choice Single Answer
Question Processes run by the users are modeled in the use case and situation in which user plays
this role is called :-
Correct Answer Scenario
Your Answer Scenario
True/False
Question If file is too big, it gets loaded part by part.
Correct Answer True
Your Answer True
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ char c='ab'; printf("%c", c); printf("%d",c);}
Correct Answer a , 97
Your Answer a , 97
Multiple Choice Single Answer
Question Which operator is used to refer to a structure element when pointer of structure is
declared?
Correct Answer ->
Your Answer ->
Page 2 of 62
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Page 3 of 62
SCDL – 3rd Semester – C - Programming
Your Answer Logical
True/False
Question Comments cannot be nested.
Correct Answer True
Your Answer True
Multiple Choice Multiple Answer
Question What will be the output? main( ) { int a[10]={101,102,103}, i; for(i=0;i<3;i+=2) printf("%c",a[i]); }
Correct Answer e , g
Your Answer e,g
True/False
Question Input / Output instructions are used to perform the function of supplying input data to a
program and obtaining the output results from it.
Correct Answer True
Your Answer True
True/False
Question printf is used to display the output at runtime.
Correct Answer True
Your Answer True
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ char c='d';float f=1; printf("%c", c); printf("%f", c
* f);}
Correct Answer d , 100.000000
Your Answer d , 100.000000
Select The Blank
Question Just passing the address of the ________ element of the array to a function is as good as
passing the entire array to the function.
Correct Answer Zeroth
Your Answer First
Multiple Choice Single Answer
Question This funciton is used to convert a string to uppercase :-
Correct Answer strupr
Page 4 of 62
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Page 5 of 62
SCDL – 3rd Semester – C - Programming
Correct Answer True
Your Answer True
Select The Blank
Question ________ function compares first n characters of two strings without regard to case.
Correct Answer strnicmp
Your Answer strnicmp
Multiple Choice Single Answer
Question The variable name can have maximum length
Correct Answer 8 characters
Your Answer 8 characters
Multiple Choice Single Answer
Question Find out the false statement from the following
Correct Answer Each new C instruction has to be written on a separate line
Your Answer Each new C instruction has to be written on a separate line
Select The Blank
Question ________ enable us to specify the order in which the various instructions in a program are
to be executed by the computer.
Correct Answer Control Instructions
Your Answer Control Instructions
Select The Blank
Question C allows ________ variable(s) on left hand side of =.
Correct Answer only one
Your Answer only one
Select The Blank
Question To declare a function choice() which returns a character value, ________ statement is
written.
Correct Answer char choice( );
Your Answer char choice( );
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ char c='d';float f=1; printf("%c", c);
Page 6 of 62
SCDL – 3rd Semester – C - Programming
Page 7 of 62
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Page 8 of 62
SCDL – 3rd Semester – C - Programming
Correct Answer strcmpi
Your Answer strcmp
Multiple Choice Single Answer
Question Studying system domain, identifying classes & objects with their properties and expressing them
with eight notations/diagrams is called as
Correct Answer Object modeling of system.
Your Answer Object modeling of system.
Multiple Choice Multiple Answer
Question Point out the errors if any struct student{ int roll; int course, char duration; } main(){ struct
student s1; int *p; p=&s; p.roll=101; }
Correct Answer Incorrect p.roll=101 , no error but warning for suspicious pointer conversion
Your Answer Incorrect p.roll=101 , no error but warning for suspicious pointer conversion
Multiple Choice Multiple Answer
Question What will be the output? main( ) { int a[10]={65,66,67},i=0; printf("%c",a[i]++);
printf("%c",a[i]); }
Correct Answer A,B
Your Answer A,B
Select The Blank
Question ________ function is used to convert a string to upper case
Correct Answer strupr
Your Answer strupr
Multiple Choice Single Answer
Question When you pass an array as an argument to a function, what actually gets passed?
Correct Answer Address of the first element of the array [base address]
Your Answer Address of the first element of the array [base address]
Select The Blank
Question Operation between an integer and real always yields ________ result
Correct Answer a real
Your Answer a real
True/False
Question C program is nothing but a combination of functions
Correct Answer True
Page 9 of 62
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Page 10 of 62
SCDL – 3rd Semester – C - Programming
Select The Blank
Question The arguments that we pass on to main() at the command prompt are called ________
arguments.
Correct Answer command line
Multiple Choice Multiple Answer
Question Which of the following are the instructions which can be used for repeting task or checking
the conditions only once.
Correct Answer Repition or Loop , Case , Sequence Control
True/False
Question On pointer variable can be substracted from another provided both variables point to
elements of the same array.
Correct Answer True
Select The Blank
Question An array of pointers is nothing but a ________.
Correct Answer Collection of addresses
Multiple Choice Multiple Answer
Question Which operators are used to access the individual structure element.
Correct Answer . , ->
Select The Blank
Question fopen() returns ________, if file is absent.
Correct Answer NULL
Multiple Choice Single Answer
Question Two statements are written within if block without any braces, if condition is true it will :-
Correct Answer execute the first statement in the block and the 2nd will get executed irrespictive of the
condition is true or false
Match The Following
Question Correct Answer
% Modulus operator
<, >, <=, >= etc. Relational operator
== Comparison for equal value
|| Logical opertor - OR
True/False
Question strncpy() copier first n character of one string into anoter.
Correct Answer True
Multiple Choice Single Answer
Question In C, comments is given with
Correct Answer --
Multiple Choice Single Answer
Question Which of the following is valid statement to declare a string?
Page 11 of 62
SCDL – 3rd Semester – C - Programming
Page 12 of 62
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Page 13 of 62
SCDL – 3rd Semester – C - Programming
True/False
Question Multiple conditions cannot be specified with 'for' loop
Correct Answer False
True/False
Question There is no three dimensional array
Correct Answer False
Multiple Choice Multiple Answer
Question Which of the following operators have not 3rd priority in operations?
Correct Answer +,*,%
True/False
Question The sequence diagram shows flow of behaviour and collaboration of objects.
Correct Answer False
Select The Blank
Question ________model is based on actors and use cases.
Correct Answer Use case
Multiple Choice Single Answer
Question A single dimensional array has :-
Correct Answer Only rows
Select The Blank
Question ________ is used to terminate the program.
Correct Answer exit
Multiple Choice Single Answer
Question Due to complex interactions, interaction diagrams are usually difficult to draw & read. The
remedy for this is :-
Correct Answer To split the use cases into smaller activities or tasks with specifi goals
Multiple Choice Multiple Answer
Question Which of the following functions are used to find first occurrence of a character or a string in
another string?
Correct Answer strchr , strstr
Multiple Choice Single Answer
Question A function in which another function is called is refered as :-
Correct Answer calling function
Multiple Choice Single Answer
Question This function is used to compare two strings :-
Correct Answer strcmp
True/False
Question The use case may begin with no precondition or with some preconditions.
Page 14 of 62
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Page 15 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer
Question Which funciton is used to append first n characters of a string at the end of another?
Correct Answer strncat
Select The Blank
Question In call by reference of passing array elements, the function argument is always ________
Correct Answer Pointer
True/False
Question A state chart diagram shows method of execution on receipt of message and activities used in
the method.
Correct Answer True
Select The Blank
Question Circular difinition' is the another name for ________.
Correct Answer recursion.
Select The Blank
Question Booch emphasises development of mechanisms with ________ model.
Correct Answer Data
Select The Blank
Question ________ is logical NOT operator
Correct Answer !
True/False
Question puts() can display only one string at a time.
Correct Answer True
Multiple Choice Multiple Answer
Question Which of the following are not control instructions in C?
Correct Answer Input/ Output , Arithmetic
True/False
Question An Array is a Primary Constant
Correct Answer False
Multiple Choice Multiple Answer
Question Which of the following fuctions require number of characters as one of the parameters?
Correct Answer strncmp , strnset , strncpy
Match The Following
Question Correct Answer
\r carriage return
\b backspace
\f form feed
Page 16 of 62
SCDL – 3rd Semester – C - Programming
Page 17 of 62
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Page 18 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer
Question Which is the ASCII value of End of file?
Correct 26
Answer
Multiple Choice Multiple Answer
Question What will be the output main ( ) { char ch='s'; switch(ch) { case 's' : printf("%d",1);
case 'r' : printf("%d",2); case 'b' : printf("%d",3);break; default:printf("%d",4); } }
Correct 1,2,3
Answer
Multiple Choice Single Answer
Question The method for industrial development of software based on use-case-driven design is
Correct OOSE [ Object Oriented Software Engineering ]
Answer
Select The Blank
Question ________ function is used to append one string at the end of another
Correct strcat
Answer
Multiple Choice Single Answer
Question A sequence diagram shows an interaction arranged in time sequence in its :-
Correct Logical order
Answer
Multiple Choice Single Answer
Question Which function requires an enter key to be hit after accepting a single character?
Correct getchar
Answer
Multiple Choice Single Answer
Question Which of the following is correct statement to declare an array 'num' of integer type
for 50 values.
Correct int num[50]
Answer
Select The Blank
Question The keyword ________ is followed by an interger or a character constant.
Correct case
Answer
True/False
Question scanf is used to display the output
Correct False
Answer
True/False
Question "r" is a read mode to open a file which is a character not a string.
Correct False
Answer
Select The Blank
Question ________ is a relation operator used to compare for equal values
Correct ==
Answer
Multiple Choice Multiple Answer
Question Arguments can generally be passed to functions in the following two ways :-
Page 19 of 62
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Page 20 of 62
SCDL – 3rd Semester – C - Programming
Question ________ instruction helps computer to execute a group of statements repeatedly.
Correct Answer Loop control
Your Answer Loop control
Multiple Choice Multiple Answer
Question Which tasks are performed on opening a file in read mode?
Correct Answer searches a file on the disk , loading a file into memory in presense and returning NULL in
case of absent , setting up a character pointer to the first character
Your Answer searches a file on the disk , loading a file into memory in presense and returning NULL in
case of absent
Select The Blank
Question After goto, ________ has to be mentioned to pass the control.
Correct Answer label name
Your Answer exit
True/False
Question The set of statements belongining to a function are enclosed within a pair of braces.
Correct Answer True
Your Answer True
Multiple Choice Multiple Answer
Question In two dimensional array
Correct Answer First dimension is rows, and second is column , Second dimension is compulsory
whereas first is optional
Your Answer Both dimensions rows and columns are optional
Multiple Choice Multiple Answer
Question When an array has both rows and columns it is called as:-
Correct Answer 2-D array , Matrix
Your Answer 2-D array , Matrix
True/False
Question On pointer variable can be substracted from another provided both variables point to
elements of the same array.
Correct Answer True
Your Answer True
Multiple Choice Single Answer
Page 21 of 62
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Page 22 of 62
SCDL – 3rd Semester – C - Programming
Correct Answer strnicmp
Your Answer strnicmp
True/False
Question stricmp compares two string ingnoring a case.
Correct Answer True
Your Answer True
True/False
Question Formal and Actual arguments cannot be same.
Correct Answer False
Your Answer True
True/False
Question strncpy() copier first n character of one string into anoter.
Correct Answer True
Your Answer True
Multiple Choice Single Answer
Question Conversion of C programs into machine language is done with the help of
Correct Answer A Compiler
Your Answer A Compiler
Select The Blank
Question The address of the zeroth element can also be passed by just passing the ________ of
the array.
Correct Answer Name
Your Answer Name
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ char c='d'; printf("%d", c); printf("%d", c *
(7/22));}
Correct Answer 100 , 0
Your Answer 100 , 0
Multiple Choice Multiple Answer
Question What will be the output? main( ) { int a[10]={10,20,30},i=0; printf("%d",a[i]++);
printf("%d",a[i]); }
Page 23 of 62
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Page 24 of 62
SCDL – 3rd Semester – C - Programming
Correct Answer Each new C instruction has to be written on a separate line
Your Answer Each new C instruction has to be written on a separate line
True/False
Question If the value of a formal argument is changed in the called funciton, the corresponding
changes take place in the calling funciton.
Correct Answer False
Your Answer False
Select The Blank
Question A structure ________ copied to another structure of same type by simply assigning using
'=' operator.
Correct Answer can be
Your Answer can be
Multiple Choice Single Answer
Question In C, comments is given with
Correct Answer --
Your Answer --
Multiple Choice Single Answer
Question How many types are there of arguments?
Correct Answer two
Your Answer two
Multiple Choice Multiple Answer
Question Which of the following commands are used for input/output operations?
Correct Answer printf , scanf
Your Answer printf , scanf
True/False
Question C program is nothing but a combination of functions
Correct Answer True
Your Answer True
Multiple Choice Single Answer
Question What will be the output? main(){ int a=25, *b; b=&a; printf("%u",b);}
Page 25 of 62
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Select The Blank
Question: ________ operator is used to refer to the structure element, when structure pointer is declared
Correct Answer: ->
Your Answer: ->
Select The Blank
Question: Usually structure type declaration appears at the ________ of the source code file, before any
variable/functions are defined.
Correct Answer: top
Your Answer: top
Select The Blank
Question: The address of the zeroth element can also be passed by just passing the ________ of the array.
Correct Answer: Name
Your Answer: Name
Multiple Choice Single Answer
Question: Which of the following is a unformatted console I/O function to display a string?
Correct Answer: puts
Your Answer: puts
True/False
Question: Primary and Secondary are the two types of constants in C.
Correct Answer: True
Your Answer: False
Multiple Choice Multiple Answer
Question: What will be the output? main(){ int i; void show(int); for(i=65;i<68;i++) show(i);} void show(int i){
printf("\n%c",i);}
Correct Answer: A , B , C
Your Answer: A , B , C
Select The Blank
Question: Arithmatic operations can be performed on characters where their ________ value is used.
Correct Answer: ASCII
Your Answer: ASCII
Select The Blank
Question: The keyword ________ is followed by an interger or a character constant.
Correct Answer: case
Your Answer: case
Match The Following
Question Correct Answer Your Answer
% Modulus operator Modulus operator
<, >, <=, >= etc. Relational operator Relational operator
= = Comparison for equal value Comparison for equal value
|| Logical opertor - OR Logical opertor - OR
Page 26 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer
Question: The collaboration diagram shows interaction between objects and sequence of activities denoted by
:-
Correct Answer: Members
Your Answer: Methods
Select The Blank
Question: The ________ diagram is used to understand or model the flow of system through classes or
objects.
Correct Answer: Activity
Your Answer: Venn
Multiple Choice Multiple Answer
Question: What will be the output of the following main(){ int i = 1; char c='A'; printf("%d",i * c); printf("%d",i *
(c+2));}
Correct Answer: 65 , 67
Your Answer: 65 , 67
True/False
Question: An Array is a Primary Constant
Correct Answer: False
Your Answer: True
Multiple Choice Multiple Answer
Question: Which operators are used to access the individual structure element.
Correct Answer: . , ->
Your Answer: . , ->
Multiple Choice Single Answer
Question: The sequence diagram follows the following sequence :-
Correct Answer: Use-case-transaction sequence
Your Answer: Use-case-transaction sequence
Multiple Choice Single Answer
Question: Which type of I/O functions are used to perform I/O operations on various ports?
Correct Answer: Port
Your Answer: Port
Multiple Choice Multiple Answer
Question: What will be the output? main( ) { int a[10]={65,66,67},i=0; printf("%c",a[i]++); printf("%c",a[i]); }
Correct Answer: A , B
Your Answer: A , B
True/False
Question: Initialisation of the conditional variable is necessary for while loop.
Correct Answer: True
Your Answer: True
Multiple Choice Single Answer
Question: What is the another name of 'value at address' operator?
Correct Answer: indirection
Your Answer: indirection
True/False
Question: If break is not used in cases, compiler gives an error.
Page 27 of 62
SCDL – 3rd Semester – C - Programming
Correct Answer: False
Your Answer: False
Multiple Choice Single Answer
Question: If 'return' statement is written without any value, which of the following is used for empty value?
Correct Answer: nothing, only 'return;' has to be written
Your Answer: nothing, only 'return;' has to be written
Multiple Choice Single Answer
Question: C language has been developed at
Correct Answer: AT & T Bell Labs, USA
Your Answer: AT & T Bell Labs, USA
Multiple Choice Multiple Answer
Question: Which of the following modes are used to read from a file?
Correct Answer: r , r+
Your Answer: r , r+ , w
Select The Blank
Question: Booch emphasises development of mechanisms with ________ model.
Correct Answer: Data
Your Answer: Data
True/False
Question: The set of statements belongining to a function are enclosed within a pair of braces.
Correct Answer: True
Your Answer: True
Select The Blank
Question: ________ is a relation operator used to compare for equal values
Correct Answer: ==
Your Answer: ==
Multiple Choice Single Answer
Question: Which of the following statements is decision making instruction?
Correct Answer: if
Your Answer: if
Select The Blank
Question: A structure can be used to ________ a floppy.
Correct Answer: format
Your Answer: read
Multiple Choice Single Answer
Question: Two statements are written within if block without any braces, if condition is true it will :-
Correct Answer: execute the first statement in the block and the 2nd will get executed irrespictive of the
condition is true or false
Your Answer: execute the first statement in the block and the 2nd will get executed irrespictive of the condition
is true or false
True/False
Question: In an array of structures all elements of the array are stored in adjacent memory locations.
Correct Answer: True
Your Answer: True
True/False
Page 28 of 62
SCDL – 3rd Semester – C - Programming
Question: puts() can display only one string at a time.
Correct Answer: True
Your Answer: False
Multiple Choice Single Answer
Question: The break statement is used to exit from:-
Correct Answer: A for loop
Your Answer: A for loop
True/False
Question: Middle Level Language is the language which has both good programming efficiency and a good
machine efficiency
Correct Answer: True
Your Answer: True
Multiple Choice Single Answer
Question: Which function is used to open a file?
Correct Answer: fopen
Your Answer: fopen
Match The Following
Question Correct Answer Your Answer
%c Format specification for a character Format specification for a character
gets() To accept a string from keyboard To accept a string from keyboard
puts() To display a string on the screen To display a string on the screen
%s Format specification for a string Format specification for a string
Multiple Choice Single Answer
Question: When you pass an array as an argument to a function, what actually gets passed?
Correct Answer: Address of the first element of the array [base address]
Your Answer: Address of the first element of the array [base address]
Multiple Choice Multiple Answer
Question: What will be the output? main(){ char name[10]="String"; int j=0; while(name[j]!='\0')
{ printf("%c",name[j]); j+=3; } printf("%c",name[--j]);}
Correct Answer: S , i , g
Your Answer: g
Multiple Choice Single Answer
Question: An array 'num' of integer type for 3 rows and 5 columns should be declared as
Correct Answer: int num[3][5]
Your Answer: int num[3][5]
Multiple Choice Single Answer
Question: An expression contains relational operators, assignement operators, and arithmatic operators. In the
absence of parentheses, they will be evaluated in which of the following order?
Correct Answer: Arithmetic, relational, assignment
Your Answer: Arithmetic, relational, assignment
Select The Blank
Question: ________ function appends first n characters of a string at the end of another
Page 29 of 62
SCDL – 3rd Semester – C - Programming
Correct Answer: strncat
Your Answer: strncat
Multiple Choice Multiple Answer
Question: What will be the output? main(){ char name[10]="String",n[10]=""; int k; strncat(n,name,3);
for(k=0;n[k]!='\0';k++) printf("\n%d",n[k]);}
Correct Answer: 83 , 116 , 114
Your Answer: 115
Multiple Choice Multiple Answer
Question: Which of the following modes are used to write to a file?
Correct Answer: w , w+ , a
Your Answer: w , w+ , a
Select The Blank
Question: There are as many as ________ odd operators in C which can affect the evaluation of an expession
in subtle and unexpected ways
Correct Answer: 45
Your Answer: 10
Multiple Choice Multiple Answer
Question: What will be the output of the following main(){ char c='ab'; printf("%c", c); printf("%d",c);}
Correct Answer: a , 97
Your Answer: a , 97
Multiple Choice Multiple Answer
Question: Which of the following fuctions require a single string as a parameter?
Correct Answer: strlen , strlwr , strupr
Your Answer: strlen , strlwr , strupr
True/False
Question: Once file is open it is always refered by its FILE pointer
Correct Answer: True
Your Answer: True
True/False
Question: While passing an array elements to a function by call by value we pass values of array elements to
the function
Correct Answer: True
Your Answer: True
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Select The Blank
Question ________ operator gives the size of the variable in bytes.
Correct Answer sizeof()
Multiple Choice Single Answer
Question Which of the following is format specifier of a string?
Correct Answer %s
Multiple Choice Multiple Answer
Question Which of the following modes are used to write to a file?
Correct Answer w , w+ , a
Page 30 of 62
SCDL – 3rd Semester – C - Programming
True/False
Question If the file is absent, fopen() returns NULL.
Correct Answer True
Select The Blank
Question ________ is a person or device that uses the system.
Correct Answer User
Select The Blank
Question If in recursive function 'if' statement is omitted, it causes to fall in ________.
Correct Answer an indefinite loop
Multiple Choice Single Answer
Question main(){ char a; int y; scanf("%c",&a); y=(a>=65 && a<=90?1:0); printf("%d",y);} if user enters
'B' then what will be the output
Correct Answer 1
Multiple Choice Single Answer
Question Which function is used to copy one string into another?
Correct Answer strcpy
True/False
Question Infinite loop is the loop which stops when the condtions is false.
Correct Answer False
True/False
Question argv is an array of pointers.
Correct Answer True
True/False
Question strdup() duplicates a string.
Correct Answer True
Multiple Choice Single Answer
Question This funciton is used to convert a string to lowercase :-
Correct Answer strlwr
True/False
Question C program is nothing but a combination of functions
Correct Answer True
True/False
Question When array is declared with rows and columns it is called as 2-D i.e. two dimensional array
Correct Answer True
Select The Blank
Question Booch emphasises development of mechanisms with ________ model.
Correct Answer Data
Multiple Choice Multiple Answer
Question Which of the following fuctions require a single string as a parameter?
Correct Answer strlen , strlwr , strupr
Multiple Choice Multiple Answer
Question Which of the following keywords are associated with switch statement?
Correct Answer case , default , break
Multiple Choice Multiple Answer
Question Which agruments are required for fgets()?
Correct Answer address of the string , maximum length , file pointer
Page 31 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer
Question Use case defines and describes what happens in the system in logical order. This is termed as :-
Correct Answer System behaviour
Select The Blank
Question ________ function sets all characters of string to a given character.
Correct Answer strset
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ int i = 1; char c='A'; printf("%d",i * c);
printf("%d",i * (c+2));}
Correct Answer 65 , 67
Multiple Choice Multiple Answer
Question Point out the errors if any. main ( ) { int i =1; do{ printf("%d ",i ) ; i+++; }while(i<=10) }
Correct Answer +++ no such operator , ;' is required at the end of while
Multiple Choice Multiple Answer
Question Which of the following are control instructions in C?
Correct Answer Sequence Control , Selection or Decision
Multiple Choice Single Answer
Question How many nesting of structures is possible?
Correct Answer many
Select The Blank
Question ________ is an input statement in C
Correct Answer scanf
Multiple Choice Single Answer
Question What is the another name of 'value at address' operator?
Correct Answer indirection
Select The Blank
Question Arithmatic operations can be performed on characters where their ________ value is used.
Correct Answer ASCII
Multiple Choice Single Answer
Question What will be the output? main ( ) { int a = 300,b,c ; if (a>400) b = 300 ; c = 200 ; printf
( "\n%d%d", b, c) ; }
Correct Answer garbage value200
Multiple Choice Single Answer
Question When array elements are passed to a function with their values, it is called as:-
Correct Answer Call by value
True/False
Question Only one comment can be given in a C program
Correct Answer False
Select The Blank
Question ________ function is used to append one string at the end of another
Correct Answer strcat
Multiple Choice Single Answer
Question A function which is called is refered as :-
Page 32 of 62
SCDL – 3rd Semester – C - Programming
Correct Answer called function
Multiple Choice Single Answer
Question if a is a float, the expression a = 5/9 will return
Correct Answer 0.000000
Match The Following
Question Correct Answer Your Answer
Access Layer under OOA Objects whose role is to communicate to data
storage.
Objects whose role is to communicate to data
storage.
Layered architecture under TSD User interface tightly coupled with data User interface tightly coupled with
data
Business Layer under OOA Objects that represent business with data and
behaviour.
Objects that represent business with data and
behaviour.
UI layer under OOA Objects with which user interacts. Objects with which user interacts.
Multiple Choice Single Answer
Question What will happen if you try to put too many values into an array while initialising, which is
exceeding the size of the array?
Correct Answer Error message from the compiler
Select The Blank
Question ________ is logical OR operator
Correct Answer ||
Select The Blank
Question ________ function copies a string into another
Correct Answer strcpy
True/False
Question A pointer is a secondary constant.
Correct Answer True
Multiple Choice Multiple Answer
Question Point out the errors if any main( ) { int a[],i; for( ;i<=10;i++) a[i]=i+1; printf("%d",i);
printf("%d",a[100]); }
Correct Answer Size of the array is not defined , Logical error of non-initialisation of the variable I
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ char c='ab',d='A'; printf("%d", c+d);
printf("%d",2*(c+d));}
Correct Answer 162 , 324
Multiple Choice Multiple Answer
Question What will be the output? main( ) { int a[10]={10,20,30},i=0; printf("%d",a[i]++);
printf("%d",a[i]); }
Correct Answer 10 , 11
True/False
Question A function can return only one value at a time.
Correct Answer True
Select The Blank
Question ________ creates a new file in low level.
Correct Answer O_CREATE
Page 33 of 62
SCDL – 3rd Semester – C - Programming
Match The Following
Question Correct Answer Your Answer
^ No such operator No such operator
+ 2nd priority 2nd priority
* 1st priority 1st priority
= 3rd priority Evaluates first
Multiple Choice Multiple Answer
Question Which of the following combinations in arithmetic operation give real result?
Correct Answer real and real , integer and real
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ char c='d'; printf("%d", c); printf("%d", c *
(7/22));}
Correct Answer 100 , 0
True/False
Question If the value of a formal argument is changed in the called funciton, the corresponding changes
take place in the calling funciton.
Correct Answer False
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Multiple Choice Multiple Answer
Question Which of the following operators have 1st priority in operations?
Correct Answer * , / , %
Multiple Choice Multiple Answer
Question What will be the output? main(){ int i; void show(int); for(i=65;i<68;i++) show(i);} void show(int
i){ printf("\n%c",i);}
Correct Answer A , B , C
Multiple Choice Multiple Answer
Question The three main areas where text and binary mode files are different :-
Correct Answer Handling of new lines , representation of end of file , storage of numbers.
Multiple Choice Multiple Answer
Question The command line arguments are :-
Correct Answer argc , argv
Multiple Choice Single Answer
Question Maximum length of a character variable is
Correct Answer 1 character
Multiple Choice Single Answer
Question This function is used to compare first n characters of two strings :-
Correct Answer strncmp
True/False
Question The sequence diagram shows flow of behaviour and collaboration of objects.
Correct Answer False
Page 34 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer
Question If a is an integer variable, a = 5 / 2; will return a value
Correct Answer 2
Multiple Choice Single Answer
Question Which function can accept a multi-word string?
Correct Answer gets()
True/False
Question The set of statements belongining to a function are enclosed within a pair of braces.
Correct Answer True
True/False
Question Standard I/O functions are nothing but stream I/O functions.
Correct Answer True
Multiple Choice Single Answer
Question Studying system domain, identifying classes & objects with their properties and expressing them
with eight notations/diagrams is
called as
Correct Answer Object modeling of system.
Multiple Choice Single Answer
Question A sequence diagram shows an interaction arranged in time sequence in its :-
Correct Answer Logical order
Multiple Choice Multiple Answer
Question What will be the output? main(){ char name[10]="String"; int j=0; while(name[j]!='\0')
{ printf("%c",name[j]); j+=3; } printf("%
c",name[--j]);}
Correct Answer S , i , g
Multiple Choice Multiple Answer
Question When an array has both rows and columns it is called as:-
Correct Answer 2-D array , Matrix
Select The Blank
Question In design phase ________ diagrams are refined to add more details with attributes and methods
for implementation.
Correct Answer Class
Select The Blank
Question To declare a function choice() which returns a character value and has two integer arguments,
________ statement is written.
Correct Answer char choice(int,int);
True/False
Question Functions are written to avoid rewriting the same section of code which requires oftenly.
Correct Answer True
Multiple Choice Single Answer
Question An expression contains relational operators, assignement operators, and arithmatic operators. In
the absence of parentheses,
they will be evaluated in which of the following order?
Correct Answer Arithmetic, relational, assignment
True/False
Question In sense of time activity is longer and the action is relatively instantaneous.
Page 35 of 62
SCDL – 3rd Semester – C - Programming
Correct Answer True
True/False
Question The interaction diagrams are not good enough if behaviour of object is conditional and gets into a
loop.
Correct Answer True
Select The Blank
Question ________models one or more roles that a user or a system interacting the system can play.
Correct Answer Actor
Multiple Choice Multiple Answer
Question Arguments can generally be passed to functions in the following two ways :-
Correct Answer sending the values of the arguments , sending the addresses of the arguments
True/False
Question The value of the conditional variable should become false some time so that the loop can be
terminated.
Correct Answer True
Select The Blank
Question ________ is used to terminate the program.
Correct Answer exit
Select The Blank
Question Array elements should be accessed using ________ if the elements are to be accessed in a fixed
order.
Correct Answer Pointers
Multiple Choice Multiple Answer
Question What will be the output? main(){ char name[10]="String",n[10]=""; int k; strncat(n,name,3);
for(k=0;n[k]!='\0';k++) printf("\n%d",n
[k]);}
Correct Answer 83 , 116 , 114
Select The Blank
Question The link between the program and the operating systme is a structure called ________
Correct Answer FILE
Multiple Choice Single Answer
Question A function in which another function is called is refered as :-
Correct Answer calling function
Multiple Choice Single Answer
Question An array 'num' of integer type for 3 rows and 5 columns should be declared as
Correct Answer int num[3][5]
True/False
Question scanf is used to accept the input from the user.
Correct Answer True
Match The Following
Question Correct Answer Your Answer
Implementation Model Converts design object model to
implementation model based on reusable
component technology.
Converts design object model to implementation
model based on reusable component
Page 36 of 62
SCDL – 3rd Semester – C - Programming
technology.
Test Model Stipulates test strategy, test plans, test
specifications, test results and test recovary
reports.
Stipulates test strategy, test plans, test
specifications, test results and test recovary
reports.
Analysis Object Model Presents information how object model will be
executed.
Presents information how object model will be
executed.
Use case Model Defines actors inside and outside of use case
and their behaviour.
Defines actors inside and outside of use case
and their behaviour.
Select The Blank
Question 'Recursive function' must have an ________ statement some where in the function.
Correct Answer if
True/False
Question Though the formal and actual argument names are same, they are treated as different variables.
Correct Answer True
Multiple Choice Single Answer
Question In exponential form range of real constant the part that appears before 'e' is called
Correct Answer mantissa
Multiple Choice Multiple Answer
Question Which operators are used to access the individual structure element.
Correct Answer . , ->
Select The Blank
Question ________ function sets first n characters of string to a given character.
Correct Answer strnset
Multiple Choice Multiple Answer
Question Which of the following statements are valid for C language?
Correct Answer one man language , developed in 1972
Multiple Choice Single Answer
Question What will be the output? main(){ int a=25, *b; b=&a; printf("%d",*b);}
Correct Answer 25
Multiple Choice Multiple Answer
Question What will be the output? main( ) { int a[10]={101,102,103}, i; for(i=0;i<3;i+=2)
printf("%c",a[i]); }
Correct Answer e , g
Match The Following
Question Correct Answer Your Answer
Address of the last element Always size of array - 1 Always size of array - 1
Call by value in function Passing values of array elements Passing values of array elements
Call by reference in function Passing addressess of array elements Address of 1st element in an array
Base address Address of 1st element in an array Used when call by refernce is done
Select The Blank
Question ________ dimensional array can be thought of as an array of arrays of arrays.
Correct Answer 3
Page 37 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer
Question This funciton is used to convert a string to uppercase :-
Correct Answer strupr
True/False
Question Logical operators cannot be used with 'do' loop.
Correct Answer False
Select The Blank
Question ________ is logical AND operator
Correct Answer &&
Select The Blank
Question In case 'call by reference', the formal arguments of a function are always ________.
Correct Answer pointer type
Multiple Choice Multiple Answer
Question Which of the following statements are not valid for C language?
Correct Answer developed at Cambridge University , not a middle level language
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Select The Blank
Question ________ is one of the applications of a structure.
Correct Answer Database Mgt.
Multiple Choice Single Answer
Question This function is used to compare two strings :-
Correct Answer strcmp
Multiple Choice Multiple Answer
Question Which of the following statements are valid for any C program?
Correct Answer It must have main() function , Each statement must end with ';'
Match The Following
Question Correct Answer Your Answer
x*=10 = ( if x = 0 ) 0 incorrect operator
x++ = ( if x = 0 ) 1 1
--x = ( if x = 0 ) -1 -1
x+=5 = ( if x = 0) 5 5
Select The Blank
Question There are basically ________ types of instrucitons in C.
Correct Answer 4
Multiple Choice Single Answer
Question Which funciton is used to append first n characters of a string at the end of another?
Correct Answer strncat
Multiple Choice Single Answer
Question If array is initialised while declaring :-
Correct Answer Mentioning dimension is not complusory
Page 38 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ int i = 1; char c='A'; printf("%d",i * c);
printf("%f",i * (c+2));}
Correct Answer floating point error , 65
Multiple Choice Multiple Answer
Question Which of the following fuctions require at least two strings as a parameter?
Correct Answer strcpy , strcat , strcmp
True/False
Question A structure variable can be passed to a function.
Correct Answer True
Multiple Choice Multiple Answer
Question Point out the errors if any. main ( ) { int i=100; while(i<=100); {printf("%d ",i ) ; i--; }do; }
Correct Answer do; is incorrect , no ; at the end of while
Multiple Choice Single Answer
Question The sequence of states that the object goes through when it receives a message to act is shown by
the diagram called :-
Correct Answer State chart diagram
True/False
Question Middle Level Language is the language which has both good programming efficiency and a good
machine efficiency
Correct Answer True
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ printf("%d", 7/22 + 25/5); printf("%f", 7/22 +
25.0/5);}
Correct Answer 5 , 5.000000
Select The Blank
Question C allows ________ variable(s) on left hand side of =.
Correct Answer only one
Multiple Choice Single Answer
Question Which function is used to read characters from an array of characters?
Correct Answer sscanf
Select The Blank
Question In analytical phase ________ diagrams are achieved representing a system.
Correct Answer Static
True/False
Question stricmp compares two string ingnoring a case.
Correct Answer True
True/False
Question The use case may begin with no precondition or with some preconditions.
Correct Answer True
Multiple Choice Multiple Answer
Question What will be the output? main(){ char name[10]="String"; int j=strlen(name); puts(name);
printf("%d",j);}
Correct Answer String , 6
Select The Blank
Question ________ operator is decrement operator by 1.
Page 39 of 62
SCDL – 3rd Semester – C - Programming
Correct Answer --
Multiple Choice Single Answer
Question What will be the output? main ( ) { int i = 4, z =12 ; if ( i == 5 && z > 5) printf ("\nLet us C") ;
else printf ("\nWish C was free !") ; }
Correct Answer Wish C was free !
Select The Blank
Question ________ is a valid statement to declare a character pointer c.
Correct Answer char *c;
Multiple Choice Single Answer
Question A variable in C cannot start with
Correct Answer Both special symbol and a number
True/False
Question An expression is the combination of variables, constants and operators as per the syntax of the
language
Correct Answer True
Multiple Choice Multiple Answer
Question What will be the output main ( ) { char ch='s'; switch(ch) { case 's' : printf("%d",1); case 'r' :
printf("%d",2); case 'b' : printf("%
d",3);break; default:printf("%d",4); } }
Correct Answer 1 , 2 , 3
Match The Following
Question Correct Answer Your Answer
addition(int,int); return an integer value which passes 2 integer
arguments
return an integer value which passes 2 integer
arguments
addition(); an integer function with no arguments an integer function with no arguments
float addition(int, float); a float function having integer and float type
arguments
a float function having integer and float type
arguments
char addition(char,char); a char function having 2 arguments of char
type
a char function having 2 arguments of char type
Select The Blank
Question The address of the zeroth element can also be passed by just passing the ________ of the array.
Correct Answer Name
Select The Blank
Question ________ opens a file for appending in low level.
Correct Answer O_APPEND
True/False
Question While passing an array elements to a function by call by reference we pass addresses of array
elements to the function
Correct Answer True
Multiple Choice Single Answer
Question The clarity of interaction diagram is lost with complex conditional behaviour. In such cases, the
best designing tool is:
Correct Answer Activity diagram
True/False
Page 40 of 62
SCDL – 3rd Semester – C - Programming
Question The default prototype of any C function is 'int'.
Correct Answer True
Multiple Choice Multiple Answer
Question Which of the following fuctions require number of characters as one of the parameters?
Correct Answer strncmp , strnset , strncpy
Multiple Choice Single Answer
Question Class diagrams help to analyse the structure of system by identifying -
Correct Answer Objects
True/False
Question Array elements can not be passed to a function.
Correct Answer False
Multiple Choice Single Answer
Question If a is an integer, the expression, a=7/ 22 * ( 3.14 + 2) * 3 /5 ; evaluates to
Correct Answer 0
Select The Blank
Question ________ is a way to assign an address of variable a to pointer p.
Correct Answer p = &a;
Select The Blank
Question ________ instruction helps computer to execute a group of statements repeatedly.
Correct Answer Loop control
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ char c='d';float f=1; printf("%c", c); printf("%f",
c * f);}
Correct Answer d , 100.000000
Multiple Choice Single Answer
Question Infinite loop is also called by another name. What is that?
Correct Answer Odd
Select The Blank
Question A structure can be used to ________ a floppy.
Correct Answer format
True/False
Question Control instructions are used to control the sequence of execution of various statements in
program
Correct Answer True
Multiple Choice Multiple Answer
Question Which of the following are basic data types in C?
Correct Answer int , float , char
Multiple Choice Single Answer
Question While accessing individual element of a structure, its element appears :-
Correct Answer after '.' operator
Multiple Choice Multiple Answer
Question What will be the output? struct student{ int roll; int course, char duration; } main(){ struct
student s1; struct student *p; p=&s;
s.roll=101;s.course=501;s.duration='2'; p->roll=102; printf("%d%d",p->roll,s.roll); printf("%c",p-
>duration); }
Correct Answer 102102 , 2
Page 41 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Multiple Answer
Question Which of the following commands are used for input/output operations?
Correct Answer printf , scanf
True/False
Question If file is too big, it gets loaded part by part.
Correct Answer True
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
1. Multiple Choice Single Answer
Question In logical AND :-
Correct Answer Both the conditions have to be TRUE
2. Multiple Choice Multiple Answer
Question Which of the following fuctions require at least two strings as a parameter?
Correct Answer strcpy , strcat , strcmp
3. Select The Blank
Question ________ function is identical to strcmpi()
Correct Answer stricmp
4. Multiple Choice Single Answer
Question C can be used on
Correct Answer All the above
5. Multiple Choice Multiple Answer
Question Which of the following combinations in arithmetic operation give real result?
Correct Answer real and real , integer and real
6. Multiple Choice Multiple Answer
Question When an entire array is passed to a function, it could be passed by :-
Correct Answer Zeroth element of an array , Only name of the array
7. True/False
Question A function can return only one value at a time.
Correct Answer True
8. True/False
Question argv is an array of pointers.
Correct Answer True
9. True/False
Question Comments cannot be nested.
Correct Answer True
10. Multiple Choice Single Answer
Question The simple logic for system specifications is provided by a languages named :-
Correct Answer OCL [ Object Constraint Language ]
11. Multiple Choice Single Answer
Question Which of the following is not a character constant
Correct Answer 'Thank You'
Page 42 of 62
SCDL – 3rd Semester – C - Programming
12. Multiple Choice Single Answer
Question The method for industrial development of software based on use-case-driven design is
Correct Answer OOSE [ Object Oriented Software Engineering ]
Your Answer OOD [ Object Oriented Design ]
13. Select The Blank
Question ________ operator gives the size of the variable in bytes.
Correct Answer sizeof()
Your Answer sizeof()
14. Select The Blank
Question Array elements should be accessed using ________ if the elements are to be accessed in a fixed
order.
Correct Answer Pointers
15. Multiple Choice Single Answer
Question How many types are there of arguments?
Correct Answer two
16. Multiple Choice Single Answer
Question UML uses :
Correct Answer OCL [ object Constraint Language ]
17. True/False
Question When array elements are passed to a function with call by reference, function has pointer
arguments.
Correct Answer True
18. Multiple Choice Single Answer
Question When the method is chosen and performed on the data, the object status changes. The static
object assumes :-
Correct Answer Dynamic state
19. True/False
Question A constant is a quantity that doesn't change
Correct Answer True
20. Multiple Choice Single Answer
Question In sequence diagram, the horizontal arrowhead line shows
Correct Answer Message 'from- to'
21. Select The Blank
Question Operation between ________ and a real always yields a Real result
Correct Answer a Real
22. Multiple Choice Multiple Answer
Question Opening a file establishes a link between :-
Correct Answer the program , the operating system
23. Multiple Choice Single Answer
Question The collaboration diagram shows both :-
Correct Answer Collaboration and sequence
24. Multiple Choice Single Answer
Question In exponential form range of real constant the part that appears before 'e' is called
Correct Answer mantissa
25. True/False
Page 43 of 62
SCDL – 3rd Semester – C - Programming
Question The interaction diagrams are not good enough if behaviour of object is conditional and gets into a
loop.
Correct Answer True
26. True/False
Question The control instructions determine the 'flow of control' in a program.
Correct Answer True
27. Multiple Choice Multiple Answer
Question What will be the output? main ( ) { int suite = 3 ; switch (suite) { case 1:printf( "\nDiamonds" ) ;
case 2:printf( "\nSpade" ) ; default :printf( "\nHea rt" ) ; }printf ("\nI thought one wears a suite") ; }
Correct Answer Heart , I thought one wears a suite
28. Select The Blank
Question After the case, ________ expression is not allowed.
Correct Answer float
29. Multiple Choice Multiple Answer
Question What will be the output of the following main(){ int a=10,b=20,c; printf("%d", a + b);
printf("%d", c+a); c=a;}
Correct Answer 30 , garbage value
30. Multiple Choice Single Answer
Question A function which is called is refered as :-
Correct Answer called function
31. Multiple Choice Single Answer
Question Which of the following is a unformatted console I/O function to get a string input?
Correct Answer gets
32. Select The Blank
Question ________ is a output statement in C
Correct Answer printf
33. Select The Blank
Question ________ function compares first n characters of two strings without regard to case.
Correct Answer strnicmp
34. Multiple Choice Single Answer
Question Though the names of formal and actual arguments are similar, they are treated as different
variables because they are :-
Correct Answer in different functions
35. Match The Following
Question Correct Answer Your Answer
1) \r carriage return carriage return
2) \b backspace bakslash
3) \f form feed form feed
4) \t tab tab
36. True/False
Question Functions are written to avoid rewriting the same section of code which requires oftenly.
Correct Answer True
37. Select The Blank
Question ________ is a person or device that uses the system.
Correct Answer User
38. Select The Blank
Page 44 of 62
SCDL – 3rd Semester – C - Programming
Question ________ function is used to convert a string to upper case
Correct Answer strupr
39. Select The Blank
Question Any C statement ends with ________.
Correct Answer ;
40. Multiple Choice Multiple Answer
Question When an array has both rows and columns it is called as:-
Correct Answer 2-D array , Matrix
41. Match The Following
Question Correct Answer Your Answer
1) addition(int,int); return an integer value which passes 2 integer arguments Both arguments of float type
which returns real value.
2) addition(); an integer function with no arguments an integer function with no arguments
3) float addition(int, float); a float function having integer and float type arguments a float function having
integer and float type arguments
4) char addition(char,char); a char function having 2 argumen ts of char type a char function having 2
arguments of char type
42. True/False
Question In collaboration diagrams, the connection between objects is shown.
Correct Answer True
43. Multiple Choice Multiple Answer
Question What will be the output of the following main(){ char c='d'; printf("%d", c); printf("%d", c *
(7/22));}
Correct Answer 100 , 0
44. Multiple Choice Multiple Answer
Question What will be the output of the following main(){ char c='d';float f=1; printf("%c", c); printf("%f",
c * f);}
Correct Answer d , 100.000000
45. True/False
Question Logical operator s cannot be used with 'do' loop.
Correct Answer False
46. Multiple Choice Single Answer
Question In which type, the values are passed to a function?
Correct Answer call by value
47. Select The Blank
Question ________ should be avoided in programming.
Correct Answer goto
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Multiple Choice Single Answer
Question Integer can have maximum value
Page 45 of 62
SCDL – 3rd Semester – C - Programming
Correct Answer 32767
Your Answer 32767
Select The Blank
Question ________models one or more roles that a user or a system interacting the system can play.
Correct Answer Actor
Your Answer Actor
Select The Blank
Question ________ is a output statement in C
Correct Answer printf
Your Answer printf
Multiple Choice Single Answer
Question The language used by UA to develop Object Oriented systems is :-
Correct Answer UML
Your Answer UML
True/False
Question The value of the conditional variable should become false some time so that the loop can be
terminated.
Correct Answer True
Your Answer True
Select The Blank
Question After the case, ________ expression is not allowed.
Correct Answer float
Your Answer float
Select The Blank
Question The ________ diagram is used to understand or model the flow of system through classes
or objects.
Correct Answer Activity
Your Answer Activity
Multiple Choice Single Answer
Question Use case steps are executed in :-
Correct Answer Logical order
Your Answer Logical order
Multiple Choice Multiple Answer
Question What will be the output? main ( ) { int suite = 3 ; switch (suite) { case 1:printf(
"\nDiamonds" ) ; case 2:printf( "\nSpade" ) ; default :printf( "\nHeart" ) ; }printf ("\nI thought one wears a
suite") ; }
Correct Answer Heart , I thought one wears a suite
Your Answer Heart , I thought one wears a suite
Multiple Choice Single Answer
Question This function is used to compare two strings without regard to case :-
Correct Answer strcmpi
Your Answer strcmp
Multiple Choice Single Answer
Question A variable in C cannot start with
Correct Answer Both special symbol and a number
Your Answer Both special symbol and a number
Multiple Choice Single Answer
Page 46 of 62
SCDL – 3rd Semester – C - Programming
Question The break statement is used to exit from:-
Correct Answer A for loop
Your Answer A for loop
Multiple Choice Multiple Answer
Question Which of the following information is stored in a FILE?
Correct Answer current size , location in memory
Your Answer current size , location in memory
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ char c='ab',d='A'; printf("%d", c+d);
printf("%d",2 * c + d);}
Correct Answer 162 , 259
Your Answer 162 , 324
Select The Blank
Question Decision and ________ instructions allow the computer to take a decision as to which
instruction is to be executed next.
Correct Answer Case
Your Answer Case
Multiple Choice Single Answer
Question The method for industrial development of software based on use-case-driven design is
Correct Answer OOSE [ Object Oriented Software Engineering ]
Your Answer OOSE [ Object Oriented Software Engineering ]
True/False
Question An expression is the combination of variables, constants and operators as per the syntax of
the language
Correct Answer True
Your Answer True
Multiple Choice Multiple Answer
Question What will be the output? main( ) { int a[10]={101,102,103}, i; for(i=0;i<3;i+=2)
printf("%c",a[i]); }
Correct Answer e,g
Your Answer e , g
Multiple Choice Multiple Answer
Question Which of the following statements are not valid for C language?
Correct Answer developed at Cambridge University , not a middle level language
Your Answer developed at Cambridge University , not a middle level language
True/False
Question The sequence diagram shows flow of behaviour and collaboration of objects.
Correct Answer False
Your Answer False
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ char c='d';float f=1; printf("%c", c);
printf("%d", c * f);}
Correct Answer d,0
Your Answer d , 0
True/False
Question While passing an array elements to a function by call by reference we pass addresses of
array elements to the function
Correct Answer True
Your Answer True
Page 47 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer
Question The language used for modeling and documenting system is :-
Correct Answer UML
Your Answer UML
Multiple Choice Single Answer
Question The approach of object oriented analysis and design that centers on understanding how the
system is actually used is :-
Correct Answer Use-case-driven design
Your Answer Use-case-driven design
Select The Blank
Question ________ opens a file for appending in low level.
Correct Answer O_APPEND
Your Answer O_APPEND
Match The Following
Question Correct Answer Your Answer
Base address Address of 1st element in an array Address of 1st element in an array
Address of the last element Always size of array - 1 Always size of array - 1
Call by value in function Passing values of array elements Passing values of array elements
Call by reference in function Passing addressess of array elements Passing addressess of array elements
True/False
Question UML supports both static modeling and dynamic modeling
Correct Answer True
Your Answer True
Select The Blank
Question ________ mode arithmetic statement is an arithmetic statement in which all operands are
either integer varaibles or integer constant.
Correct Answer Integer
Your Answer Integer
Multiple Choice Single Answer
Question if an integer a = 2 and float b =6, the expression a + b evaluates to
Correct Answer 8.000000
Your Answer 8.000000
Multiple Choice Multiple Answer
Question What will be the output? main(){ char name[10]="String"; int j=strlen(name); puts(name);
printf("%d",j);}
Correct Answer String , 6
Your Answer String , 6
Match The Following
Question Correct Answer Your Answer
^ No such operator No such operator
+ 2nd priority 2nd priority
* 1st priority 1st priority
Page 48 of 62
SCDL – 3rd Semester – C - Programming
= 3rd priority 3rd priority
True/False
Question In sense of time activity is longer and the action is relatively instantaneous.
Correct Answer True
Your Answer True
Multiple Choice Single Answer
Question main(){ char a; int y; scanf("%c",&a); y=(a>=65 && a<=90?1:0); printf("%d",y);} if user
enters 'B' then what will be the output
Correct Answer 1
Your Answer 1
Select The Blank
Question In case 'call by value', the actual arguments of a function are always ________
Correct Answer address of the variables
Your Answer address of the variables
Multiple Choice Multiple Answer
Question What will be the output? main(){ int a=25, *b, **c; b=&a;c=&b; printf("%d",*c);
printf("%u %u",b,c}
Correct Answer garbage value , address of a , address of b
Your Answer garbage value , address of a , address of b
Multiple Choice Multiple Answer
Question What will be the output of the following main(){ char c='d';float f=1; printf("%c", c);
printf("%f", c * f);}
Correct Answer d , 100.000000
Your Answer d , 100.000000
Multiple Choice Single Answer
Question A single dimensional array has :-
Correct Answer Only rows
Your Answer Only rows
Multiple Choice Single Answer
Question What will happen if you try to put too many values into an array while initialising, which is
exceeding the size of the array?
Correct Answer Error message from the compiler
Your Answer Error message from the compiler
Multiple Choice Multiple Answer
Question In two dimensional array
Correct Answer First dimension is rows, and second is column , Second dimension is compulsory
whereas first is optional
Your Answer First dimension is rows, and second is column , Second dimension is compulsory whereas
first is optional
True/False
Question Structure variable appears before the '.' while accessing the individual element of a structure
Correct Answer True
Your Answer True
Multiple Choice Single Answer
Question The unified approach [ UA ] is used to build
Correct Answer Object Oriented system
Your Answer Object Oriented system
Page 49 of 62
SCDL – 3rd Semester – C - Programming
Select The Blank
Question ________ dimensional array can be thought of as an array of arrays of arrays.
Correct Answer 3
Your Answer 3
Multiple Choice Single Answer
Question Conversion of C programs into machine language is done with the help of
Correct Answer A Compiler
Your Answer A Compiler
True/False
Question All structure elements are stored in contiguous memory locations.
Correct Answer True
Your Answer True
Select The Blank
Question ________ should be avoided in programming.
Correct Answer goto
Your Answer goto
Multiple Choice Multiple Answer
Question Which of the following are the instructions which can be used for repeting task or checking
the conditions only once.
Correct Answer Repition or Loop , Case , Sequence Control
Your Answer Repition or Loop , Case , Sequence Control
True/False
Question There is no three dimensional array
Correct Answer False
Your Answer False
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Select The Blank
Question: Operation between ________ and integer always yields an integer result
Correct Answer: an integer
Your Answer: an integer
Select The Blank
Question: ________ function is identical to strcmpi()
Correct Answer: stricmp
Your Answer: stricmp
Multiple Choice Multiple Answer
Question: What will be the output of the following main(){ char c='d';float f=1; printf("%c", c);
printf("%f", c * f);}
Correct Answer: d , 100.000000
Your Answer: d , 100.000000 , 100
True/False
Question: fputc() can be used to write to a VDU.
Correct Answer: False
Your Answer: True
Page 50 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer
Question: Class diagrams help to analyse the structure of system by identifying -
Correct Answer: Objects
Your Answer: Objects
Select The Blank
Question: Operation between an integer and real always yields ________ result
Correct Answer: a real
Your Answer: a real
Multiple Choice Multiple Answer
Question: Which of the following operators have 1st priority in operations?
Correct Answer: * , / , %
Your Answer: * , / , %
True/False
Question: In sequence diagrams, the connection between objects is shown.
Correct Answer: False
Your Answer: True
Multiple Choice Single Answer
Question: Processes run by the users are modeled in the use case and situation in which user plays this
role is called :-
Correct Answer: Scenario
Your Answer: Condition
Multiple Choice Single Answer
Question: Which operator is used to refer to a structure element when pointer of structure is declared?
Correct Answer: ->
Your Answer: -->
Select The Blank
Question: An array of pointers is nothing but a ________.
Correct Answer: Collection of addresses
Your Answer: Collection of addresses
Multiple Choice Multiple Answer
Question: Which of the following combinations in arithmetic operation give an integer result?
Correct Answer: integer and integer , integer and character
Your Answer: integer and integer , integer and real
Multiple Choice Multiple Answer
Question: What will be the output of the following main(){ char c='ab',d='A'; printf("%d", c+d);
printf("%d",2*(c+d));}
Correct Answer: 162 , 324
Your Answer: 162 , 324
True/False
Question: There are basically 5 types of instructions in C
Correct Answer: False
Your Answer: False
Multiple Choice Single Answer
Question: Due to complex interactions, interaction diagrams are usually difficult to draw & read. The
remedy for this is :-
Correct Answer: To split the use cases into smaller activities or tasks with specifi goals
Your Answer: To split the use cases into smaller activities or tasks with specifi goals
Page 51 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer
Question: Studying system domain, identifying classes & objects with their properties and expressing them
with eight notations/diagrams is called as
Correct Answer: Object modeling of system.
Your Answer: Object modeling of system.
Select The Blank
Question: Any C statement ends with ________.
Correct Answer: ;
Your Answer: ;
True/False
Question: A variable is a name given to the location in memory where the constant is stored
Correct Answer: True
Your Answer: True
True/False
Question: If break is not used in cases, compiler gives an error.
Correct Answer: False
Your Answer: False
True/False
Question: Through behavior modeling we understand relationships, nature of interactions and response
between various elements of the system. The behavior model throws light on functionality, features and
outputs within the framework of conditions and constraints over a period of time.
Correct Answer: True
Your Answer: True
Multiple Choice Single Answer
Question: Which function is used to overcome the limitation of scanf of inability to accept multi-word
string?
Correct Answer: gets
Your Answer: getstring
Multiple Choice Single Answer
Question: Conversion of C programs into machine language is done with the help of
Correct Answer: A Compiler
Your Answer: A Compiler
Multiple Choice Single Answer
Question: The language used by UA to develop Object Oriented systems is :-
Correct Answer: UML
Your Answer: UML
Multiple Choice Multiple Answer
Question: Which of the following statements are valid for C language?
Correct Answer: one man language , developed in 1972
Your Answer: developed in 1972 , Only Low level language
True/False
Question: The use case may begin with no precondition or with some preconditions.
Correct Answer: True
Your Answer: True
Multiple Choice Multiple Answer
Question: Two dimensional array has :-
Correct Answer: Rows , Columns
Your Answer: Rows , Columns
Page 52 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Multiple Answer
Question: Point out the errors if any. main ( ) { int i =1; do{ printf("%d ",i ) ; i+++; }while(i<=10) }
Correct Answer: +++ no such operator , ;' is required at the end of while
Your Answer: ;' is required at the end of while , empty brackets should appear after do , intialisation is not
necessary
Multiple Choice Single Answer
Question: In case multiples statements are to be executed in if-block those have to be enclosed within :-
Correct Answer: { }
Your Answer: { }
Select The Blank
Question: In switch, ________ never have a constant to check.
Correct Answer: default
Your Answer: default
Multiple Choice Single Answer
Question: Which is the ASCII value of End of file?
Correct Answer: 26
Your Answer: 26
Select The Blank
Question: ________ is a relation operator used to compare for unequal values
Correct Answer: !=
Your Answer: !=
Multiple Choice Single Answer
Question: In which type, the values are passed to a function?
Correct Answer: call by value
Your Answer: call by value
Select The Blank
Question: ________ dimensional array has only rows
Correct Answer: 1
Your Answer: 1
Multiple Choice Single Answer
Question: In logical NOT :-
Correct Answer: No condition is to be TRUE
Your Answer: No condition is to be TRUE
Multiple Choice Multiple Answer
Question: Which of the following operators have not 3rd priority in operations?
Correct Answer: + , * , %
Your Answer: + , * , %
Multiple Choice Multiple Answer
Question: Which of the following information is stored in a FILE?
Correct Answer: current size , location in memory
Your Answer: current size , location in memory , buffer
Select The Blank
Question: Operation between ________ and a real always yields a Real result
Correct Answer: a Real
Your Answer: a Real
Multiple Choice Single Answer
Page 53 of 62
SCDL – 3rd Semester – C - Programming
Question: Use case defines and describes what happens in the system in logical order. This is termed as :-
Correct Answer: System behaviour
Your Answer: System analysis
Select The Blank
Question: The address of the zeroth element is also called as ________
Correct Answer: Base address
Your Answer: Base address
True/False
Question: scanf is used to accept the input from the user.
Correct Answer: True
Your Answer: True
Match The Following
Question Correct Answer Your Answer
addition(int,int); return an integer value which passes 2 integer arguments return an integer value which
passes 2 integer arguments
addition(); an integer function with no arguments Both arguments of float type which returns real value.
float addition(int, float); a float function having integer and float type arguments a float function having
integer and float type arguments
char addition(char,char); a char function having 2 arguments of char type a char function having 2
arguments of char type
Multiple Choice Multiple Answer
Question: Point out the errors if any main( ) { int a[],i; for( ;i<=10;i++) a[i]=i+1; printf("%d",i);
printf("%d",a[100]); }
Correct Answer: Size of the array is not defined , Logical error of non-initialisation of the variable I
Your Answer: Size of the array is not defined , Logical error of non-initialisation of the variable I , in a[100]
it is exceeding the size of the array.
True/False
Question: In Low Level Disk I/O functions, buffer management has to be done explicitly by the
programmer.
Correct Answer: True
Your Answer: False
Multiple Choice Single Answer
Question: Which of the following form is possible to express the real constant
Correct Answer: Both fractional and exponential forms
Your Answer: Both fractional and exponential forms
True/False
Question: No pointer is possible to point a structure.
Correct Answer: False
Your Answer: False
Match The Following
Question Correct Answer Your Answer
\r carriage return carriage return
\b backspace bakslash
\f form feed form feed
Page 54 of 62
SCDL – 3rd Semester – C - Programming
\t tab tab
Multiple Choice Multiple Answer
Question: With O_CREATE flag 'permission argument' is required which could be
Correct Answer: S_IWRITE , S_IREAD
Your Answer: S_IWRITE , S_IREAD
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Multiple Choice Single Answer
Question: What will happen if you put too few elements in an array when you initialise it?
Correct Answer: Unused elements will be filled with 0's or garbage
Your Answer: Unused elements will be filled with 0's or garbage
Multiple Choice Single Answer
Question: The main advantage of using state chart diagram is :-
Correct Answer: it provides an understanding of process & algorithm used in the method.
Your Answer: it provides an understanding of process & algorithm used in the method.
Select The Blank
Question: Operation between ________ and a real always yields a Real result
Correct Answer: a Real
Your Answer: a Real
Select The Blank
Question: ________ dimensional array has both rows and columns
Correct Answer: 2
Your Answer: 2
True/False
Question: The sequence diagram shows a task or activity sequence but do not show the relationship
between objects through the roles that play in the interaction.
Correct Answer: True
Your Answer: True
Multiple Choice Single Answer
Question: What is the limit on no. of functions in one C program :-
Correct Answer: no
Your Answer: 255
Match The Following
Question Correct Answer Your Answer
Implementation Model Converts design object model to implementation model based on reusable
component technology. Converts design object model to implementation model based on reusable
component technology.
Test Model Stipulates test strategy, test plans, test specifications, test results and test recovary reports.
Stipulates test strategy, test plans, test specifications, test results and test recovary reports.
Page 55 of 62
SCDL – 3rd Semester – C - Programming
Analysis Object Model Presents information how object model will be executed. Presents information
how object model will be executed.
Use case Model Defines actors inside and outside of use case and their behaviour. Defines actors inside
and outside of use case and their behaviour.
Select The Blank
Question: ________ is one of the applications of a structure.
Correct Answer: Database Mgt.
Your Answer: Database Mgt.
True/False
Question: An Integer is a Primary Constant
Correct Answer: True
Your Answer: True
Multiple Choice Single Answer
Question: In this the condition is specified at the beginning of the loop :-
Correct Answer: while
Your Answer: while
True/False
Question: Only one comment can be given in a C program
Correct Answer: False
Your Answer: False
True/False
Question: If the value of a formal argument is changed in the called funciton, the corresponding changes
take place in the calling funciton.
Correct Answer: False
Your Answer: False
Multiple Choice Multiple Answer
Question: What will be the output of the following main(){ int a = 1;float f=1; printf("%d", a * f);
printf("%f", a * f); printf(%f",a + f * 100);}
Correct Answer: 0 , 1.000000 , 101.000000
Your Answer: 0 , 1.000000 , 101.000000
Multiple Choice Multiple Answer
Question: Which of the following operators have 1st priority in operations?
Correct Answer: * , / , %
Your Answer: * , / , %
Multiple Choice Single Answer
Question: Maximum length of an Integer data type is
Correct Answer: -32767 to 32767
Your Answer: 32767
True/False
Question: Logical operators cannot be used with 'do' loop.
Correct Answer: False
Your Answer: False
Multiple Choice Single Answer
Question: Which parameter needs to be passed with fgetc()?
Correct Answer: FILE pointer
Your Answer: First character in a file
Page 56 of 62
SCDL – 3rd Semester – C - Programming
Select The Blank
Question: The arguments that we pass on to main() at the command prompt are called ________
arguments.
Correct Answer: command line
Your Answer: command line
Select The Blank
Question: C allows ________ variable(s) on left hand side of =.
Correct Answer: only one
Your Answer: only one
Multiple Choice Multiple Answer
Question: What will be the output? main( ) { int a[10],i=0; for( ;i<=10;i++) a[i]=i+1; printf("%d",i);
printf("%d",a[i-=2]); }
Correct Answer: 11 , 10
Your Answer: 11 , 10 , error
Select The Blank
Question: Break / continue is generally associated with ________.
Correct Answer: if
Your Answer: while
Multiple Choice Single Answer
Question: In this the condition is specified at the end of the loop :-
Correct Answer: do
Your Answer: do
Multiple Choice Multiple Answer
Question: Arguments can generally be passed to functions in the following two ways :-
Correct Answer: sending the values of the arguments , sending the addresses of the arguments
Your Answer: sending the values of the arguments , sending the addresses of the arguments
Select The Blank
Question: The argument for the fflush() must be ________.
Correct Answer: buffer
Your Answer: argv[0]
Select The Blank
Question: There are as many as ________ odd operators in C which can affect the evaluation of an
expession in subtle and unexpected ways
Correct Answer: 45
Your Answer: 45
Select The Blank
Question: There are basically ________ types of instrucitons in C.
Correct Answer: 4
Your Answer: 6
Multiple Choice Single Answer
Question: Due to complex interactions, interaction diagrams are usually difficult to draw & read. The
remedy for this is :-
Correct Answer: To split the use cases into smaller activities or tasks with specifi goals
Your Answer: To split the use cases into smaller activities or tasks with specifi goals
Multiple Choice Single Answer
Question: In logical NOT :-
Correct Answer: No condition is to be TRUE
Your Answer: No condition is to be TRUE
Page 57 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Multiple Answer
Question: What will be the output of the following main(){ char c='ab',d='A'; printf("%d", c+d);
printf("%d",2*(c+d));}
Correct Answer: 162 , 324
Your Answer: 162 , 324
True/False
Question: Standard I/O functions are nothing but stream I/O functions.
Correct Answer: True
Your Answer: True
Multiple Choice Single Answer
Question: The unified approach [ UA ] is used to build
Correct Answer: Object Oriented system
Your Answer: Object Oriented system
Multiple Choice Single Answer
Question: Which of the following is a format specifier to display the address of a variable?
Correct Answer: %u
Your Answer: %u
Multiple Choice Multiple Answer
Question: What will be the output of the following main(){ int a=10,b=20,c; printf("%d", a + b);
printf("%d", c+a); c=a;}
Correct Answer: 30 , garbage value
Your Answer: 30 , garbage value
True/False
Question: switch requires an integer expression.
Correct Answer: True
Your Answer: True
Select The Blank
Question: ________ dimensional array can be thought of as an array of arrays of arrays.
Correct Answer: 3
Your Answer: 3
Multiple Choice Multiple Answer
Question: What will be the output? main(){ char name[10]="String",n[10]; puts(strcpy(n,name));
printf("%d",strcmp(n,name));}
Correct Answer: String , 0
Your Answer: String , 0
Multiple Choice Multiple Answer
Question: What will be the output of the following main(){ char c='d';float f=1; printf("%c", c);
printf("%f", c * f);}
Correct Answer: d , 100.000000
Your Answer: d , 100.000000
Multiple Choice Multiple Answer
Question: Point out the errors if any struct student{ int roll; int course, char duration; } main(){ struct
student s1; int *p; p=&s; p.roll=101; }
Correct Answer: Incorrect p.roll=101 , no error but warning for suspicious pointer conversion
Your Answer: Incorrect p.roll=101 , no error but warning for suspicious pointer conversion
Select The Blank
Question: ________models one or more roles that a user or a system interacting the system can play.
Correct Answer: Actor
Your Answer: Actor
Page 58 of 62
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer
Question: Which is the ASCII value of End of file?
Correct Answer: 26
Your Answer: 26
Multiple Choice Multiple Answer
Question: Which of the following functions are used to find first occurrence of a character or a string in
another string?
Correct Answer: strchr , strstr
Your Answer: strchr , strstr
True/False
Question: The values of a structure varialbe cannot be assigned to another structure variable of the same
type.
Correct Answer: False
Your Answer: False
True/False
Question: When array is declared with rows and columns it is called as 2-D i.e. two dimensional array
Correct Answer: True
Your Answer: True
Match The Following
Question Correct Answer Your Answer
B Ken Thompson at AT & T Ken Thompson at AT & T
ALGOL International Committee International Committee
CPL Cambridge University Cambridge University
BCPL Martin Richards at Cambridge University Martin Richards at Cambridge University
Multiple Choice Multiple Answer
Question: What will be the output of the following main(){ int i = 1; char c='A'; printf("%d",i * c);
printf("%d",i * (c+2));}
Correct Answer: 65 , 67
Your Answer: 65 , 67
Multiple Choice Multiple Answer
Question: Which of the following are not control instructions in C?
Correct Answer: Input/ Output , Arithmetic
Your Answer: Input/ Output , Arithmetic
True/False
Question: Structure and union are primary constants
Correct Answer: False
Your Answer: False
[I] Multiple Choice Single Answer:
1) Find error if any:
main()
{ int a=20, *j;
j=&a;
printf(“%d”,j);
}
Page 59 of 62
SCDL – 3rd Semester – C - Programming
2) What will be the output?
main()
{ char name [10]=”String”;
strset(name, ‘*’);
puts(name);
}
Ans:=>****** (I choose this option as the answer in the exam)
3) Total keywords in 'C' are :
Ans:=> 32
4) What will be the output?
main()
{ int num [20], i=0;
num[0]=10.0;
num[2]=20;
i+=5;
printf(“%d%d”, num[i+=2], num[i-=5]);
}
5) What will be the output?
main()
{ int i=40, z=12;
if(i=5 || z>5)
printf(“\n Better Snacks”);
else
printf(“\n Not Worth”);
}
Ans:=> Better Snacks
6) The range of real constant in exponential form is:
Ans: => -3.4e38 to 3.4e38
7) What will be the output?
# include<stdio.h>
main()
{ int i;
long double id;
i=ld;
printf(“%d”, i);
}
Ans:=> 10
8) Find error if any:
main()
{ int suite = 1;
Switch (suite);
{ case 0: printf(“\n Club”);
case 1: printf(“\n Diamonds”);
}
}
9) What will be the output?
Page 60 of 62
SCDL – 3rd Semester – C - Programming
main()
{ printf(“\n C to it that C survives”);
main();
}
Ans:=> infinite (I choose this option as the answer in the exam)
10) Which of the following is not a character constant?
Ans:=> 'Thank You'
11) What will be the output?
main ( )
{ int i = 4, z =12;
if ( i == 5 && z > 5)
printf ("\nLet us C");
else
printf ("\nWish C was free !");
}
Ans:=> Wish C was free !
13) What will be the output?
main()
{ let_us_c()
{ printf(“C is a simple language”);
printf(“Others are no match”);
}
}
14) What will be the output?
main()
{ int a=25, *b;
b=&a;
printf("%u",b);
}
Ans:=> memory address of a variable 'a'
15) It displays a single character on the screen:-
Ans:=> putch
[II]Multiple Choice Multiple Answer:
16) …….something abt mantissa and exponent …….(I dun’t remember the question properly)
18) The command line arguments are :-
Ans:=> argc , argv
19) O_Create…………S_Iread, S_IWrite…….(I dun’t remember the question properly)
20) What will be the output of the following?
main()
{ int a = 1;
float f=1;
printf("%d", a * f);
printf("%f", a * f);
printf(%f",a + f * 100);}
Ans:=> 0 , 1.000000 , 101.000000
21) The three main areas where text and binary mode files are different :-
Ans:=> Handling of new lines , representation of end of file , storage of numbers.
22) Which of the following fuctions require a single string as a parameter?
Page 61 of 62
SCDL – 3rd Semester – C - Programming
Ans:=> strlen , strlwr , strupr
23) When an array has both rows and columns it is called as:-
Ans:=> 2-D array , Matrix
[III] True / False:
24) m/c level language is low level language
Ans:=> True
27) Maximum length of a character variable is 1 character
Ans: True
28) & operator prints the address of the variable.
29) empty () after main is not necessary
[IV] Fill in the Blanks:
30) Arithmatic operations can be performed on characters where their ________ value is used
Ans:=> ASCII
31) ________ is logical AND operator
Ans:=> &&
34) There are basically ________ types of instrucitons in C.
Ans:=> 4
36) Just passing the address of the ________ element of the array to a function is as good as passing the
entire array to the function.
Ans:=> Zeroth
[V]Match The Following:
39) 1) String %s
2) Signed character %c
3) double %lf
4) float %f
%i
New line escape sequence
40) 1) \r carriage return
2) \b backspace
3) \f form feed
4) \t tab
Page 62 of 62