Post on 26-Mar-2015
transcript
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Multiple Choice Single Answer Question C language has been introduced in the year
Correct Answer 1972
Your Answer 1972
Multiple Choice Single Answer Question if a is a float, the expression a = 5/9 will return
Correct Answer 0.000000
Your Answer 0.000000
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 scanf is used to display the output
Correct Answer False
Your Answer False
True/False Question The keywords are also called as 'Reserved Keywords'
Correct Answer True
Your Answer True
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 ';'
Your Answer It must have main() function , Each statement must end with ';'
Match The FollowingQuestion 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 Multiple Answer
Page 1 of 109
SCDL – 3rd Semester – C - Programming
Question Which of the following commands are used for input/output operations?
Correct Answer printf , scanf
Your Answer printf , scanf
Multiple Choice Single Answer Question Name the header file in which FILE is defined :-
Correct Answer stdio.h
Your Answer stdio.h
Multiple Choice Single Answer Question UML uses :
Correct Answer OCL [ object Constraint Language ]
Your Answer OCL [ object Constraint Language ]
True/False Question Just like array of int / float, there can be array of pointers.
Correct Answer True
Your Answer True
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
Select The Blank Question ________ opens a file for appending in low level.
Correct Answer O_APPEND
Your Answer O_APPEND
Multiple Choice Single Answer Question It displays a single character on the screen:-
Correct Answer putch
Your Answer putch
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
Select The Blank Question ________ function is used to convert a string to upper case
Page 2 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer strupr
Your Answer strupr
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
Multiple Choice Single Answer Question Which of the following functions of a floppy can be done using structure?
Correct Answer formatting a floppy
Your Answer formatting a floppy
Multiple Choice Multiple Answer Question What will be the output? main ( ) { int i = 0 ; switch ( i ) { case 0:printf("\nTemple is
a non-issue" ) ; case 1:printf ("\nAandhi is never stable") ; case 2:printf ("\nMandl will ruin India" ) ; break; case 3:printf ("\nWe want better politicians" ) ;} }
Correct Answer Temple is a non-issue , Andhi is never stable , Mandl will ruin India
Your Answer Temple is a non-issue , Andhi is never stable , Mandl will ruin India
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
Your Answer 5 , 5.000000
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
Your Answer floating point error , 65
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 Logical operators cannot be used with 'do' loop.
Correct Answer False
Your Answer False
Multiple Choice Single Answer
Page 3 of 109
SCDL – 3rd Semester – C - Programming
Question A sequence diagram shows an interaction arranged in time sequence in its :-
Correct Answer Logical order
Your Answer Logical order
Select The Blank Question ________ function is used to remove any data remaining in the buffer.
Correct Answer fflush
Your Answer fflush
Match The FollowingQuestion Correct Answer Your Answer
contiguous memory structure elements structure elements
int *a; an integer pointer an integer pointer
char *ch; a character pointer a character pointer
%u a format specifier of address of the value.
a format specifier of address of the value.
Select The Blank Question ________ is logical NOT operator
Correct Answer !
Your Answer !
Select The Blank Question After the case, ________ expression is not allowed.
Correct Answer float
Your Answer float
True/False Question An Integer is a Primary Constant
Correct Answer True
Your Answer True
Multiple Choice Multiple Answer Question Which of the following combinations in arithmetic operation give real result?
Correct Answer real and real , integer and real
Your Answer real and real , integer and real
Select The Blank Question ________ mode arithmetic statement is an arithmetic statement in which all
operands are either real variables or real constant. Correct Answer Real
Your Answer Real
Page 4 of 109
SCDL – 3rd Semester – C - Programming
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
True/False Question The set of statements belongining to a function are enclosed within a pair of
braces. Correct Answer True
Your Answer True
True/False Question strdup() duplicates a string.
Correct Answer True
Your Answer True
Multiple Choice Single Answer Question In declaration char name[20]; it can hold
Correct Answer 20 characters
Your Answer 20 characters
Select The Blank Question 'Recursive function' must have an ________ statement some where in the
function. Correct Answer if
Your Answer if
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 Single Answer Question While accessing individual element of a structure, its element appears :-
Correct Answer after '.' operator
Your Answer after '.' operator
Select The Blank Question In design phase ________ diagrams are refined to add more details with attributes
and methods for implementation. Correct Answer Class
Your Answer Class
Page 5 of 109
SCDL – 3rd Semester – C - Programming
True/False Question Continue statement is used to exit from the current loop and to continue with the
next immediate statement after the loop. Correct Answer False
Your Answer False
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 ________ 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 ) ; }
Page 6 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer x and y are equal
Your Answer x and y are equal
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Select The Blank Question ________ instruction helps computer to execute a group of statements repeatedly.
Correct Answer Loop control
Your Answer Loop control
Multiple Choice Single Answer
Question Use case steps are executed in :-
Correct Answer Logical order
Your Answer Logical order
True/False
Question Multiple conditions cannot be specified with 'for' loop
Correct Answer False
Your Answer False
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 Which operators are used to access the individual structure element.
Correct Answer . , ->
Your Answer . , ->
Multiple Choice Single Answer
Question This function is used to find number of characters in a string :-
Correct Answer strlen
Your Answer strlen
Multiple Choice Single Answer
Question Which of the following is a enclosure of a string value.
Correct Answer "
Your Answer "
Page 7 of 109
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer Question This function is used to compare two strings :-
Correct Answer strcmp
Your Answer strcmp
Multiple Choice Single Answer Question What is a string?
Correct Answer A character array
Your Answer A character array
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
Select The Blank Question ________ is one of the applications of a structure.
Correct Answer Database Mgt.
Your Answer Database Mgt.
Select The Blank Question In switch, ________ never have a constant to check.
Correct Answer default
Your Answer default
True/False Question Like primary variable and arrays, structure variables cannot be initialised where they are
declared Correct Answer False
Your Answer True
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 Single Answer Question Which function is used to close a file?
Correct Answer fclose
Your Answer fclose
Page 8 of 109
SCDL – 3rd Semester – C - Programming
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 , 1
Multiple Choice Single Answer Question The unified approach [ UA ] is used to build
Correct Answer Object Oriented system
Your Answer Procedural systems
Select The Blank Question ________ dimensional array has only rows
Correct Answer 1
Your Answer 1
Select The Blank Question Multiple statement of each 'case' should be enclosed within ________
Correct Answer nothing
Your Answer nothing
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 strstr() finds number of occurences of a give string in another string.
Correct Answer False
Your Answer True
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
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
Page 9 of 109
SCDL – 3rd Semester – C - Programming
Your Answer 162 , 324
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
Match The FollowingQuestion 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
Passing addressess of array elements
Base address Address of 1st element in an array Address of 1st element in an array
Multiple Choice Single Answer Question The simple logic for system specifications is provided by a languages named :-
Correct Answer OCL [ Object Constraint Language ]
Your Answer OOPL [ Object oriented Programming Language ]
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
Select The Blank Question To reverse a string, ________ function is used.
Correct Answer strrev
Your Answer strrev
Select The Blank Question After goto, ________ has to be mentioned to pass the control.
Correct Answer label name
Your Answer label name
Multiple Choice Multiple Answer Question Which of the following are basic data types in C?
Correct Answer int , float , char
Your Answer int , float , char
Page 10 of 109
SCDL – 3rd Semester – C - Programming
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 False
Match The FollowingQuestion Correct Answer Your Answer
Array of pointers Collection of addresses Collection of addresses
Accessing array elements in fixed order
Using pointers Using pointers
Accessing array elements in non-fixed order
Using subscripts Using subscripts
Matrix 2-D array 2-D array
True/False Question Before writing to a file or reading from a file, it must be open.
Correct Answer True
Your Answer True
Multiple Choice Multiple Answer Question Which of the following keywords are associated with switch statement?
Correct Answer case , default , break
Your Answer case , default , break
Select The Blank Question fopen() returns ________, if file is absent.
Correct Answer NULL
Your Answer NULL
Select The Blank Question ________ is escape sequence for new line.
Correct Answer \n
Your Answer \n
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
Your Answer System behaviour
Page 11 of 109
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer Question What will happen if you assign a value to an element of an array whose subscript exceeds
the size of the array? Correct Answer Nothing, it's done all the time
Your Answer Error message from the compiler
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( );
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
Page 12 of 109
SCDL – 3rd Semester – C - Programming
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 ->
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
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 S , i , g
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
Multiple Choice Single Answer Question Which type of function does not return any value?
Correct Answer void
Your Answer void
Select The Blank
Question ________ is an assignment operator.
Correct Answer =
Your Answer =
Multiple Choice Single Answer
Page 13 of 109
SCDL – 3rd Semester – C - Programming
Question An array is a collection of :-
Correct Answer The same data type placed next to each other in memory
Your Answer The same data type placed next to each other in memory
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
Your Answer 102102 , 2
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
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 Which of the following is valid return statement?
Correct Answer return(25 + 22);
Your Answer return(25 + 22);
Multiple Choice Single Answer Question This function is used to find number of characters in a string :-
Correct Answer strlen
Your Answer strlen
Select The Blank Question The statements in C must appear in the ________ order in which those to be executed.
Correct Answer same
Your Answer same
Page 14 of 109
SCDL – 3rd Semester – C - Programming
Multiple Choice Multiple Answer Question Which of the following functions are used to set all / n characters of a string to a given
character? Correct Answer strset , strnset
Your Answer strset , strnset
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 Octal modeling of system
Multiple Choice Single Answer
Question Which of the following is a contol instruction in C.
Correct Answer Selection or Decision
Your Answer Selection or Decision
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 character
True/False
Question When array elements are passed to a function with call by reference, function has pointer arguments.
Correct Answer True
Your Answer True
Select The Blank Question When the values are passed to a function as an argument, it is called as ________
Correct Answer call by value
Your Answer call by value
Multiple Choice Single Answer Question A character pointer of the FILE points to which character ?
Correct Answer first
Page 15 of 109
SCDL – 3rd Semester – C - Programming
Your Answer first
Match The FollowingQuestion 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.
Analysis Object Model Presents information how object model will be executed.
Defines actors inside and outside of use case and their behaviour.
Use case Model Defines actors inside and outside of use case and their behaviour.
Presents information how object model will be executed.
Select The Blank
Question ________ could be the alternate for if when it is related to integer / character constant expression only.
Correct Answer switch
Your Answer switch
True/False Question strchr() find first occurrence of a given character in a string.
Correct Answer True
Your Answer True
Match The FollowingQuestion Correct Answer Your Answer
^ No such operator No such operator
+ 2nd priority 2nd priority
* 1st priority Evaluates first
= 3rd priority 3rd priority
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
Your Answer System designing
Multiple Choice Multiple Answer
Page 16 of 109
SCDL – 3rd Semester – C - Programming
Question Which functions are High level, Text, Unformatted String I/O functions?
Correct Answer fgets , fputs
Your Answer fgets , fputs
Multiple Choice Single Answer Question Which is the place of return statement in the called function?
Correct Answer any where
Your Answer at the end
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
Select The Blank Question Circular difinition' is the another name for ________.
Correct Answer recursion.
Your Answer recursion.
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 Single Answer Question Total keywords in 'C' are
Correct Answer 32
Your Answer 32
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
Page 17 of 109
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer Question This function is used to compare first n characters of two strings :-
Correct Answer strncmp
Your Answer strncmp
Multiple Choice Multiple Answer
Question Which of the following fuctions require number of characters as one of the parameters?
Correct Answer strncmp , strnset , strncpy
Your Answer strncmp , strnset , strncpy
True/False Question One structure can be nested within another structure.
Correct Answer True
Your Answer True
Select The Blank
Question In analytical phase ________ diagrams are achieved representing a system.
Correct Answer Static
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
Page 18 of 109
SCDL – 3rd Semester – C - Programming
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
Your Answer strupr
Select The Blank Question Array elements should be accessed using ________ if the elements are to be accessed in a
fixed order. Correct Answer Pointers
Your Answer Pointers and subscripts
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 Returning more than one value at a time from a function can be overcome by using
________. Correct Answer pointers
Page 19 of 109
SCDL – 3rd Semester – C - Programming
Your Answer pointers
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 Single Answer Question What will be the output? main(){ int a=25, *b; b=&a; printf("%d",*b);}
Correct Answer 25
Your Answer 25
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
Your Answer 5 , 5.000000
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
True/False Question strncpy() copier first n character of one string into anoter.
Correct Answer True
Your Answer True
Select The Blank
Question To reverse a string, ________ function is used.
Correct Answer strrev
Your Answer strrev
Match The FollowingQuestion Correct Answer Your Answer
^ No such operator No such operator
+ 2nd priority 2nd priority
Page 20 of 109
SCDL – 3rd Semester – C - Programming
* 1st priority 1st priority
= 3rd priority 3rd priority
True/False Question Infinite loop is the loop which stops when the condtions is false.
Correct Answer False
Your Answer False
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 address of a , address of b
Multiple Choice Multiple Answer Question Which of the following are basic data types in C?
Correct Answer int , float , char
Your Answer int , float , char
True/False Question Comments cannot be nested.
Correct Answer True
Your 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
Your Answer mantissa
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
Page 21 of 109
SCDL – 3rd Semester – C - Programming
Question Operation between ________ and integer always yields an integer result
Correct Answer an integer
Your Answer an integer
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
Multiple Choice Single Answer Question The data passed from one object to another is called :-
Correct Answer Message
Your Answer Message
Select The Blank Question In switch, ________ never have a constant to check.
Correct Answer default
Your Answer default
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 are valid prototypes of a function?
Correct Answer float , char
Your Answer integer , float , char
Multiple Choice Multiple Answer Question Which of the following modes are used to read from a file?
Correct Answer r , r+
Your Answer a , r , r+
Page 22 of 109
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
Your Answer System behaviour
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 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 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.
Your Answer Handling of new lines , storage of numbers. , Handling of tabs
Multiple Choice Multiple Answer Question Which functions are High level, Text, Unformatted String I/O functions?
Correct Answer fgets , fputs
Your Answer fgets , fputs
True/False Question If the file is absent, fopen() returns NULL.
Correct Answer True
Your Answer False
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 Selection
Page 23 of 109
SCDL – 3rd Semester – C - Programming
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 Single Answer Question Use case steps are executed in :-
Correct Answer Logical order
Your Answer Serial order
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
True/False Question An Integer is a Primary Constant
Correct Answer True
Your Answer True
Multiple Choice Single Answer Question A character pointer of the FILE points to which character ?
Correct Answer first
Your Answer first
Select The Blank
Question After goto, ________ has to be mentioned to pass the control.
Correct Answer label name
Your Answer label name
Multiple Choice Single Answer
Question Which of the following is valid return statement?
Correct Answer return(25 + 22);
Page 24 of 109
SCDL – 3rd Semester – C - Programming
Your Answer return(25 + 22);
True/False Question argv is an array of pointers.
Correct Answer True
Your Answer True
True/False Question When array elements are passed to a function with call by reference, function has pointer
arguments. Correct Answer True
Your Answer True
Select The Blank Question ________ is an input statement in C
Correct Answer scanf
Your Answer scanf
Multiple Choice Single Answer Question A two dimensional array has :-
Correct Answer Both rows and columns
Your Answer Both rows and columns
True/False Question strlen() doesn't count '\0' in a length.
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
Page 25 of 109
SCDL – 3rd Semester – C - Programming
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);
printf("%d", c * f);} Correct Answer d , 0
Your Answer d , 100
Match The FollowingQuestion Correct Answer Your Answer
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 Defines actors inside and outside
Page 26 of 109
SCDL – 3rd Semester – C - Programming
of use case and their behaviour. of use case and their behaviour.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.
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 False
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
Your Answer do; is incorrect , it will turn into infinite loop
Multiple Choice Multiple Answer Question Which of the following combinations in arithmetic operation give real result?
Correct Answer real and real , integer and real
Your Answer real and real , integer and real
Multiple Choice Single Answer Question Which pointer operator is used to display the address of a variable?
Correct Answer &
Your Answer &
LIST OF ATTEMPTED QUESTIONS AND ANSWERS True/False Question There are basically 5 types of instructions in C
Correct Answer False
Your Answer False
Multiple Choice Single Answer Question A function definition is enclosed within :-
Correct Answer { }
Your Answer ( )
Page 27 of 109
SCDL – 3rd Semester – C - Programming
Select The Blank Question ________ is logical OR operator
Correct Answer ||
Your Answer ||
Multiple Choice Multiple Answer Question Which of the following operators have 1st priority in operations?
Correct Answer * , / , %
Your Answer * , / , %
Select The Blank Question In analytical phase ________ diagrams are achieved representing a system.
Correct Answer Static
Your Answer Static
Match The FollowingQuestion Correct Answer Your Answer
continue continues the immediate loop loop counter initialisation is necessary.
if decision control statement decision control statement
do loop structure continues the immediate loop
break terminates the immediate loop terminates the immediate loop
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
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
Multiple Choice Multiple Answer Question Which of the following statements are valid for C language?
Page 28 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer one man language , developed in 1972
Your Answer one man language , developed in 1972
Select The Blank Question ________ function sets all characters of string to a given character.
Correct Answer strset
Your Answer strset
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
Multiple Choice Multiple Answer Question What will be the output? main ( ) { int i = 0 ; switch ( i ) { case 0:printf("\nTemple is a non-
issue" ) ; case 1:printf ("\nAandhi is never stable") ; case 2:printf ("\nMandl will ruin India" ) ; break; case 3:printf ("\nWe want better politicians" ) ;} }
Correct Answer Temple is a non-issue , Andhi is never stable , Mandl will ruin India
Your Answer Temple is a non-issue , Andhi is never stable , Mandl will ruin India
True/False Question strdup() duplicates a string.
Correct Answer True
Your Answer True
Multiple Choice Multiple Answer Question Which of the following functions are used to set all / n characters of a string to a given character?
Correct Answer strset , strnset
Your Answer strset , strnset
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 , Both dimensions rows and columns are optional
Match The Following
Page 29 of 109
SCDL – 3rd Semester – C - Programming
Question Correct Answer Your Answer
putch() displays a single character displays a single character
getche() echoes a typed character echoes a typed character
getch() does not echo a typed character does not echo a typed character
getchar() echoes a typed character, but an enter key should be hitted.
echoes a typed character, but an enter key should be hitted.
Multiple Choice Single Answer Question Use case steps are executed in :-
Correct Answer Logical order
Your Answer Logical order
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
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 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 Single Answer Question The language used by UA to develop Object Oriented systems is :-
Correct Answer UML
Your Answer UML
True/False Question A function can return only one value at a time.
Correct Answer True
Page 30 of 109
SCDL – 3rd Semester – C - Programming
Your Answer True
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 Single Answer 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 behaviour
Multiple Choice Multiple Answer Question Which of the following fuctions require number of characters as one of the parameters?
Correct Answer strncmp , strnset , strncpy
Your Answer strncmp , strnset , strncpy
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
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 values of the variables
Multiple Choice Single Answer Question Which is the place of return statement in the called function?
Correct Answer any where
Your Answer any where
Multiple Choice Single Answer Question How much memory is occupied by each character in the array?
Correct Answer one byte
Page 31 of 109
SCDL – 3rd Semester – C - Programming
Your Answer two bytes
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
Multiple Choice Single Answer Question Class diagrams help to analyse the structure of system by identifying -
Correct Answer Objects
Your Answer Objects
True/False Question break statement is used to terminate the program.
Correct Answer False
Your Answer False
True/False Question A Structure element appears before the '.' while accessing the individual element of a structure
Correct Answer False
Your Answer False
True/False Question Though the formal and actual argument names are same, they are treated as different variables.
Correct Answer True
Your Answer True
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 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.
Page 32 of 109
SCDL – 3rd Semester – C - Programming
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
Your Answer True
Select The Blank Question When the values are passed to a function as an argument, it is called as ________
Correct Answer call by value
Page 33 of 109
SCDL – 3rd Semester – C - Programming
Your Answer call by value
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
Multiple Choice Single Answer Question Which of the following is a unformatted console I/O function to get a string input?
Correct Answer gets
Your Answer gets
Select The Blank Question ________ writes characters to a file.
Correct Answer fputc
Your Answer fputc
Select The Blank Question ________ operator in C is used to perform the exponentiation operation.
Correct Answer No
Your Answer ^
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
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
Page 34 of 109
SCDL – 3rd Semester – C - Programming
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 FollowingQuestion 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?
Correct Answer char name[20];
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
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
Select The Blank Question In design phase ________ diagrams are refined to add more details with attributes and
methods for implementation.
Page 35 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer Class
Multiple Choice Single Answer Question In this the condition is specified at the beginning of the loop :-
Correct Answer while
Select The Blank Question ________ opens a file for appending in low level.
Correct Answer O_APPEND
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 basic data types in C?
Correct Answer int , float , char
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
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
Multiple Choice Single Answer Question What will be the output? main(){ int a=25, *b; b=&a; printf("%u",b);}
Correct Answer memory address of a variable 'a'
Multiple Choice Single Answer Question Individual element in the array can be referred with :-
Correct Answer Subscript
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
True/False Question strdup() duplicates a string.
Correct Answer True
Multiple Choice Single Answer Question The language used for modeling and documenting system is :-
Correct Answer UML
True/False
Page 36 of 109
SCDL – 3rd Semester – C - Programming
Question strupr() function is used to convert a string into upper case.
Correct Answer True
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
True/False Question One structure can be nested within another structure.
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.
Match The FollowingQuestion Correct Answer
%c Format specification for a character
gets() To accept a string from keyboard
puts() To display a string on the screen
%s Format specification for a string
True/False Question When array elements are passed to a function with call by reference, function has pointer
arguments. Correct Answer True
Select The Blank Question ________ is one of the keywords in C.
Correct Answer char
Multiple Choice Single Answer Question Which of the following statements is decision making instruction?
Correct Answer if
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
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 Multiple Answer
Page 37 of 109
SCDL – 3rd Semester – C - Programming
Question Which of the following statements are valid for C language?
Correct Answer one man language , developed in 1972
Select The Blank Question ________ function is identical to strcmpi()
Correct Answer stricmp
Select The Blank Question ________ is an input statement in C
Correct Answer scanf
Select The Blank Question ________ is logical OR operator
Correct Answer ||
Multiple Choice Multiple Answer Question Which of the following are valid prototypes of a function?
Correct Answer float , char
Multiple Choice Multiple Answer Question Which of the following are not control instructions in C?
Correct Answer Input/ Output , Arithmetic
Multiple Choice Single Answer Question A variable in C cannot start with
Correct Answer Both special symbol and a number
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
True/False Question In TSD based client server architecture, the user interface is loosely coupled with the data.
Correct Answer False
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
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
True/False Question A constant is a quantity that doesn't change
Page 38 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer True
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
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
Page 39 of 109
SCDL – 3rd Semester – C - Programming
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.
Correct Answer True
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
Multiple Choice Single Answer Question C Language has been developed by
Correct Answer Dennis Ritchie
Multiple Choice Single Answer Question Total keywords in 'C' are
Correct Answer 32
True/False Question UML supports both static modeling and dynamic modeling
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 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
True/False Question The control instructions determine the 'flow of control' in a program.
Correct Answer True
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
Select The Blank Question ________ is an assignment operator.
Correct Answer =
Select The Blank Question ________ writes characters to a file.
Page 40 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer fputc
Multiple Choice Single Answer Question if an integer a = 2 and float b =6, the expression a + b evaluates to
Correct Answer 8.000000
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 Which of the following functions are used to set all / n characters of a string to a given
character? Correct Answer strset , strnset
True/False Question The values of a structure varialbe cannot be assigned to another structure variable of the
same type. Correct Answer False
Select The Blank Question After the case, ________ expression is not allowed.
Correct Answer float
Match The FollowingQuestion Correct Answer
B Ken Thompson at AT & T
ALGOL International Committee
CPL Cambridge University
BCPL Martin Richards at Cambridge University
Multiple Choice Multiple Answer Question Which tasks are performed on opening a file in read mode?
Correct Answer loading a file into memory in presense and returning NULL in case of absent , setting up a character pointer to the first character , searches a file on the disk
Multiple Choice Single Answer Question The range of real constant in exponential form is
Correct Answer -3.4e38 to 3.4e38
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
Match The FollowingQuestion Correct Answer
contiguous memory structure elements
Page 41 of 109
SCDL – 3rd Semester – C - Programming
int *a; an integer pointer
char *ch; a character pointer
%u a format specifier of address of the value.
Multiple Choice Multiple Answer Question Which of the following information is stored in a FILE?
Correct Answer current size , location in memory
Select The Blank Question Operation between ________ and a real always yields a Real result
Correct Answer a Real
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
Select The Blank Question A structure can be used to ________ the size of the cursor.
Correct Answer change
True/False Question Before writing to a file or reading from a file, it must be open.
Correct Answer True
Select The Blank Question ________ function copies a string into another
Correct Answer strcpy
Multiple Choice Multiple Answer Question Which of the following are valid prototypes of a function?
Correct Answer float , char
Multiple Choice Single Answer Question In logical OR :-
Correct Answer Either of the conditions has to be TRUE
True/False Question Array elements can not be passed to a function.
Correct Answer False
Multiple Choice Single Answer Question C can be used on
Correct Answer All the above
True/False Question Through behavior modeling we understand relationships, nature of interactions and response
Page 42 of 109
SCDL – 3rd Semester – C - Programming
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
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 Multiple Answer Question What will be the output? main ( ) { int i ; for(i=1;i<=5;i++){ printf("%d ",i ) ; if(i==3)
break; } } Correct Answer 1 , 2 , 3
Select The Blank Question ________models one or more roles that a user or a system interacting the system can play.
Correct Answer Actor
Select The Blank Question In design phase ________ diagrams are refined to add more details with attributes and
methods for implementation. Correct Answer Class
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
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
Page 43 of 109
SCDL – 3rd Semester – C - Programming
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 FollowingQuestion Correct Answer
\r carriage return
\b backspace
\f form feed
\t tab
Multiple Choice Single Answer Question While accessing individual element of a structure, its element appears :-
Correct Answer after '.' operator
Multiple Choice Single Answer Question A subscript of first element in an array is :-
Correct Answer 0
True/False Question break statement is used to terminate the program.
Correct Answer False
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
Multiple Choice Single Answer Question Which function is used to accept a character without echoeing on the screen?
Page 44 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer getch
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
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
True/False Question switch requires an integer expression.
Correct Answer True
Select The Blank Question The ________ diagram is used to understand or model the flow of system through classes or
objects. Correct Answer Activity
Multiple Choice Single Answer Question Use case steps are executed in :-
Correct Answer Logical order
True/False Question Structure variable appears before the '.' while accessing the individual element of a structure
Correct Answer True
Select The Blank Question ________ is logical AND operator
Correct Answer &&
Select The Blank Question ________ dimensional array has both rows and columns
Correct Answer 2
True/False Question The return statement should present at the end of the called function.
Correct Answer False
Select The Blank Question Array elements should be accessed using ________ if there is no fixed logic in accessing the
elemnts. Correct Answer Subscripts
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
True/False
Page 45 of 109
SCDL – 3rd Semester – C - Programming
Question One structure can be nested within another structure.
Correct Answer True
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 Single Answer Question How many times 'return' statement can be written?
Correct Answer any
Multiple Choice Single Answer Question It displays a single character on the screen:-
Correct Answer putch
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
Multiple Choice Multiple Answer Question The command line arguments are :-
Correct Answer argc , argv
True/False Question Continue statement is used to exit from the current loop and to continue with the next
immediate statement after the loop. Correct Answer False
Multiple Choice Single Answer Question The language used by UA to develop Object Oriented systems is :-
Correct Answer UML
Match The FollowingQuestion Correct Answer
x > 0 ? 'T' : 'F' ( if x = 5 ) 84
x > 5 ? 100 : 0 ( if x = 5 ) 0
x == 5 ? 200 : 100 ( if x = 5 ) 200
x < 35 ?( x == 5?50:10):30 ( if x = 5 )
50
Select The Blank Question An array of pointers is nothing but a ________.
Correct Answer Collection of addresses
True/False Question The default prototype of any C function is 'int'.
Page 46 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer True
Multiple Choice Multiple Answer Question With O_CREATE flag 'permission argument' is required which could be
Correct Answer S_IWRITE , S_IREAD
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 What will be the output? main ( ) { int k, num = 30 ; k = ( num > 5 ? (num <= 10 ? 100 : 200 )
:500 ) ; printf ( "\n%d", k ) ; } Correct Answer 200
Multiple Choice Single Answer Question In sequence diagram, the horizontal lines are arranged in sequence of their
Correct Answer Occurrence
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
Multiple Choice Single Answer Question Maximum length of a character variable is
Correct Answer 1 character
Multiple Choice Multiple Answer Question The addresses present in the array of pointers can be addresses of :-
Correct Answer Isolated variables , Array elements , Any other addresses
Multiple Choice Single Answer Question From expression - a = 6.6 / x + ( 5 * a + (3 * r)) / ( 5 / x ) which operation will be performed
first? Correct Answer ( 3 * r )
Select The Blank Question Returning more than one value at a time from a function can be overcome by using ________.
Correct Answer pointers
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Multiple Choice Single Answer Question Which is the ASCII value of End of file?
Correct 26
Page 47 of 109
SCDL – 3rd Semester – C - Programming
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 Answer
1 , 2 , 3
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 ]
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 sequence diagram shows an interaction arranged in time sequence in its :-
Correct Answer
Logical order
Multiple Choice Single Answer Question Which function requires an enter key to be hit after accepting a single character?
Correct Answer
getchar
Multiple Choice Single Answer Question Which of the following is correct statement to declare an array 'num' of integer type
for 50 values. Correct Answer
int num[50]
Select The Blank Question The keyword ________ is followed by an interger or a character constant.
Correct Answer
case
True/False Question scanf is used to display the output
Correct Answer
False
True/False Question "r" is a read mode to open a file which is a character not a string.
Correct Answer
False
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 :-
Correct Answer
sending the values of the arguments , sending the addresses of the arguments
Multiple Choice Single Answer Question The approach of object oriented analysis and design that centers on understanding
Page 48 of 109
SCDL – 3rd Semester – C - Programming
how the system is actually used is :- Correct Answer
Use-case-driven design
Select The Blank Question When the addresses of variables are passed to a function as an argument, it is called
as ________ Correct Answer
call by reference
Multiple Choice Single Answer Question The language used for modeling and documenting system is :-
Correct Answer
UML
Multiple Choice Single Answer Question UML uses :
Correct Answer
OCL [ object Constraint Language ]
Multiple Choice Single Answer Question What will be the output? main(){ int a=25, *b; b=&a; printf("%u",b);}
Correct Answer
memory address of a variable 'a'
Match The FollowingQuestion Correct Answer
putch() displays a single character
getche() echoes a typed character
getch() does not echo a typed character
getchar() echoes a typed character, but an enter key should be hitted.
True/False Question Real falls under secondary constant
Correct Answer
False
Select The Blank Question In analytical phase ________ diagrams are achieved representing a system.
Correct Answer
Static
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
Multiple Choice Single Answer Question Which pointer operator is used to display the address of a variable?
Correct Answer
&
True/False Question Logical operators cannot be used with 'do' loop.
Correct False
Page 49 of 109
SCDL – 3rd Semester – C - Programming
Answer True/False
Question strchr() find first occurrence of a given character in a string.
Correct Answer
True
Select The Blank Question C allows ________ variable(s) on left hand side of =.
Correct Answer
only one
Select The Blank Question When the values are passed to a function as an argument, it is called as ________
Correct Answer
call by value
Multiple Choice Single Answer Question The simple logic for system specifications is provided by a languages named :-
Correct Answer
OCL [ Object Constraint Language ]
Select The Blank Question ________ is one of the keywords in C.
Correct Answer
char
Multiple Choice Single Answer Question The unified approach [ UA ] is used to build
Correct Answer
Object Oriented system
Select The Blank Question The statements in C must appear in the ________ order in which those to be executed.
Correct Answer
same
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 Individual element in the array can be referred with :-
Correct Answer
Subscript
Multiple Choice Single Answer Question Which type of I/O functions are used to receive input from keyboard?
Correct Answer
Console
Multiple Choice Single Answer Question The collaboration diagram shows interaction between objects & sequence of
activities denoted by : Correct Answer
Number
True/False
Page 50 of 109
SCDL – 3rd Semester – C - Programming
Question There are basically 5 types of instructions in C
Correct Answer
False
Match The FollowingQuestion Correct Answer
addition(int,int); return an integer value which passes 2 integer arguments
addition(); an integer function with no arguments
float addition(int, float); a float function having integer and float type arguments
char addition(char,char); a char function having 2 arguments of char type
Multiple Choice Single Answer Question Point out error in main ( ) { int a[10], i ; for ( i = 1; i <= 10; i++ ) { scanf ( "%d",
a[i] ); printf ( "%d", a[i] ); } } Correct Answer
& is missing in scanf
True/False Question strlen() doesn't count '\0' in a length.
Correct Answer
True
Select The Blank Question ________ creates a new file in low level.
Correct Answer
O_CREATE
Multiple Choice Multiple Answer Question Which of the following operators have 2nd priority in operations?
Correct Answer
+ , -
Multiple Choice Multiple Answer Question Which operators are used to access the individual structure element.
Correct Answer
. , ->
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
True/False Question In sequence diagrams, the connection between objects is shown.
Correct Answer
False
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 ';'
Multiple Choice Single Answer Question The mechanism used to convey information to the function is called as :-
Page 51 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer
argument
True/False Question printf is used to display the output at runtime.
Correct Answer
True
True/False Question Middle Level Language is the language which has both good programming efficiency
and a good machine efficiency Correct Answer
True
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
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 formal
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 strstr
Match The FollowingQuestion Correct Answer Your Answer
contiguous memory structure elements structure elements
int *a; an integer pointer an integer pointer
char *ch; a character pointer a character pointer
%u a format specifier of address of the value.
a format specifier of address of the value.
Multiple Choice Single Answer Question The expression c = 4 + 2 % -8 evaluates to
Correct Answer 6
Your Answer None of the above
Page 52 of 109
SCDL – 3rd Semester – C - Programming
Multiple Choice Single Answer Question Maximum length of a character variable is
Correct Answer 1 character
Your Answer 254 characters
True/False Question Continue statement is used to exit from the current loop and to continue with the next
immediate statement after the loop. Correct Answer False
Your Answer False
Select The Blank Question ________ compares two strings to find out whether they are same or different.
Correct Answer strcmp
Your Answer strcmp
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]
True/False Question Type Declaration Instruction is used to declare the type of variables being used in the
program. Correct Answer True
Your Answer True
True/False Question The default prototype of any C function is 'int'.
Correct Answer True
Your Answer True
Multiple Choice Single Answer Question if a is a float, the expression a = 5.0/9 will return
Correct Answer 0.555556
Page 53 of 109
SCDL – 3rd Semester – C - Programming
Your Answer 0.555556
True/False Question One structure can be nested within another structure.
Correct Answer True
Your 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.
Your Answer Object modeling of system.
True/False Question The keywords should not be used as variables.
Correct Answer True
Your Answer True
Select The Blank Question The link between the program and the operating systme is a structure called ________
Correct Answer FILE
Your Answer FILE
Select The Blank Question ________ is used to terminate the program.
Correct Answer exit
Your Answer break
Multiple Choice Multiple Answer Question Which of the following commands are used for input/output operations?
Correct Answer printf , scanf
Your Answer printf , scanf , getch()
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));}
Page 54 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer 162 , 324
Your Answer Error
Match The FollowingQuestion Correct Answer Your Answer
|| Logical opertor - OR Logical opertor - OR
% Modulus operator Modulus operator
<, >, <=, >= etc. Relational operator Relational operator
= = Comparison for equal value Comparison for equal value
Multiple Choice Single Answer Question Use case steps are executed in :-
Correct Answer Logical order
Your Answer Logical order
Multiple Choice Single Answer Question The size of the array is enclosed within
Correct Answer []
Your Answer []
Multiple Choice Single Answer Question This function is used to compare first n characters of two strings :-
Correct Answer strncmp
Your Answer strncmp
Multiple Choice Single Answer Question The range of real constant in exponential form is
Correct Answer -3.4e38 to 3.4e38
Your Answer -3.4e38 to 3.4e38
Multiple Choice Multiple Answer Question Which agruments are required for fgets()?
Correct Answer address of the string , maximum length , file pointer
Page 55 of 109
SCDL – 3rd Semester – C - Programming
Your Answer address of the string , maximum length , file pointer
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.
Your Answer Handling of new lines , representation of end of file , storage of numbers.
Select The Blank Question The keyword ________ is followed by an interger or a character constant.
Correct Answer case
Your Answer case
Select The Blank Question In design phase ________ diagrams are refined to add more details with attributes and
methods for implementation. Correct Answer Class
Your Answer Class
True/False Question strncpy() copier first n character of one string into anoter.
Correct Answer True
Your Answer True
True/False Question Control instructions are used to control the sequence of execution of various statements
in program Correct Answer True
Your Answer True
Select The Blank Question ________ should be avoided in programming.
Correct Answer goto
Your Answer goto
True/False Question Whenever the control returns from a function some value is definitely returned.
Page 56 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer True
Your Answer False
Multiple Choice Single Answer Question How many times 'return' statement can be written?
Correct Answer any
Your Answer any
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 I thought one wears a suite , Heart
Your Answer Heart , I thought one wears a suite
Select The Blank 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
Page 57 of 109
SCDL – 3rd Semester – C - Programming
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 Question In declaration char name[20]; it can hold
Correct Answer 20 characters
Your Answer 20 characters
Select The Blank Question In switch, ________ never have a constant to check.
Correct Answer default
Your Answer default
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 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
Page 58 of 109
SCDL – 3rd Semester – C - Programming
Your Answer 65 , 67.000000
Multiple Choice Single Answer Question if a is a float, the expression a = 5/9 will return
Correct Answer 0.000000
Your Answer 0.000000
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
Your Answer 5 , 5.000000
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]
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
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
Match The FollowingQuestion 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
Page 59 of 109
SCDL – 3rd Semester – C - Programming
Select The Blank Question ________ is a valid statement to declare a character pointer c.
Correct Answer char *c;
Your Answer char *c;
Select The Blank Question ________ writes characters to a file.
Correct Answer fputc
Your Answer fputc
Multiple Choice Multiple Answer Question Which of the following fuctions require at least two strings as a parameter?
Correct Answer strcpy , strcat , strcmp
Your Answer strcpy , strcat , strcmp
True/False Question Continue statement is used to exit from the current loop and to continue with the next
immediate statement after the loop. Correct Answer False
Your Answer False
Multiple Choice Single Answer Question if a is a float, the expression a = 5/9 will return
Correct Answer 0.000000
Your Answer 0.555555
Multiple Choice Single Answer Question Which parameter needs to be passed with fgetc()?
Correct Answer FILE pointer
Your Answer FILE pointer
Multiple Choice Single Answer Question In sequence diagram, the existance of objects in the behaviour are shown by
Correct Answer Dotted line
Page 60 of 109
SCDL – 3rd Semester – C - Programming
Your Answer Thick 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
Your Answer Repition or Loop , Sequence Control
Select The Blank Question Returning more than one value at a time from a function can be overcome by using
________. Correct Answer pointers
Your Answer pointers
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 address of a , address of b
Select The Blank Question Circular difinition' is the another name for ________.
Correct Answer recursion.
Your Answer recursion.
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 1.000000 , 101.000000 , 1.00
True/False Question strdup() duplicates a string.
Correct Answer True
Your Answer True
True/False Question UML supports both static modeling and dynamic modeling
Page 61 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer True
Your Answer True
Multiple Choice Single Answer Question UML uses :
Correct Answer OCL [ object Constraint Language ]
Your Answer OOPL [ Object oriented Programming Language ]
True/False Question A structure variable can be passed to a function.
Correct Answer True
Your Answer True
Select The Blank Question Array elements should be accessed using ________ if there is no fixed logic in
accessing the elemnts. Correct Answer Subscripts
Your Answer Pointers and subscripts
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 +++ no such operator , ;' is required at the end of while
Multiple Choice Single Answer Question A sequence diagram shows an interaction arranged in time sequence in its :-
Correct Answer Logical order
Your Answer Logical order
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 , 1
Multiple Choice Single Answer
Page 62 of 109
SCDL – 3rd Semester – C - Programming
Question The clarity of interaction diagram is lost with complex conditional behaviour. In such cases, the best designing tool is:
Correct Answer Activity diagram
Your Answer Activity diagram
Select The Blank Question ________ is an input statement in C
Correct Answer scanf
Your Answer scanf
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 values of the variables
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(){ printf("%d", 7/22 + 25/5); printf("%f", 7/22
+ 25.0/5);} Correct Answer 5 , 5.000000
Your Answer 5 , 5.000000
Multiple Choice Multiple Answer Question Opening a file establishes a link between :-
Correct Answer the program , the operating system
Your Answer the program , buffer
Match The FollowingQuestion Correct Answer Your Answer
= = Checks for equal value Checks for equal value
&& Both conditions have to be true Both conditions have to be true
Page 63 of 109
SCDL – 3rd Semester – C - Programming
|| One of the conditions has to be true
One of the conditions has to be true
! Executes if condition is not true Executes if condition is not true
Multiple Choice Multiple Answer Question The command line arguments are :-
Correct Answer argc , argv
Your Answer argc , argv
Multiple Choice Single Answer Question Which of the following is a formatted console I/O function for output?
Correct Answer printf
Your Answer printf
True/False Question strrchr() find first occurrence of a given character in a string.
Correct Answer False
Your Answer False
Multiple Choice Single Answer Question In this the condition is specified at the beginning of the loop :-
Correct Answer while
Your Answer while
Select The Blank Question ________ function compares first n characters of two strings without regard to case.
Correct Answer strnicmp
Your Answer strnicmp
True/False Question stricmp compares two string ingnoring a case.
Correct Answer True
Your Answer True
True/False
Page 64 of 109
SCDL – 3rd Semester – C - Programming
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]); } Correct Answer 10 , 11
Your Answer 10 , 11
Multiple Choice Single Answer Question Which of the following is valid declaration of an integer pointer 'no'?
Correct Answer int *no;
Your Answer int *no;
Page 65 of 109
SCDL – 3rd Semester – C - Programming
Select The Blank Question Operation between ________ and integer always yields an integer result
Correct Answer an integer
Your Answer an integer
Multiple Choice Single Answer Question In declaration char name[20]; it can hold
Correct Answer 20 characters
Your Answer 20 characters
Multiple Choice Multiple Answer Question Which of the following operators have 1st priority in operations?
Correct Answer * , / , %
Your Answer /
True/False Question A three dimensional array is nothing but an array of arrays.
Correct Answer True
Your Answer False
Multiple Choice Single Answer Question The language used for modeling and documenting system is :-
Correct Answer UML
Your Answer UML
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
True/False Question Control instructions are used to control the sequence of execution of various statements
in program Correct Answer True
Your Answer True
Multiple Choice Multiple Answer
Page 66 of 109
SCDL – 3rd Semester – C - Programming
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 character
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
Select The Blank Question Returning more than one value at a time from a function can be overcome by using
________. Correct Answer pointers
Your Answer pointers
True/False Question The use case may begin with no precondition or with some preconditions.
Correct Answer True
Your Answer True
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
Match The FollowingQuestion Correct Answer Your Answer
putch() displays a single character displays a single character
getche() echoes a typed character echoes a typed character
getch() does not echo a typed character does not echo a typed character
getchar() echoes a typed character, but an enter key should be hitted.
echoes a typed character, but an enter key should be hitted.
True/False Question Primary and Secondary are the two types of constants in C.
Page 67 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer True
Your Answer True
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 The sequence diagram is an alternative to understand program that executes object
behaviour. Correct Answer True
Your Answer False
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
Multiple Choice Single Answer Question In sequence diagram, the horizontal lines are arranged in sequence of their
Correct Answer Occurrence
Your Answer Occurrence
True/False Question An Integer is a Primary Constant
Correct Answer True
Your Answer True
Multiple Choice Single Answer Question Which of the following is format specifier of a string?
Correct Answer %s
Your Answer %s
Match The Following
Page 68 of 109
SCDL – 3rd Semester – C - Programming
Question Correct Answer Your Answer
1970 B B
1960 ALGOL ALGOL
1963 CPL CPL
1967 BCPL C
Multiple Choice Single Answer Question A state chart diagram shows two states, one of the state and the other of
Correct Answer Transition between two states
Your Answer Transition between two states
Multiple Choice Single Answer Question In this the condition is specified at the beginning of the loop :-
Correct Answer while
Your Answer while
Multiple Choice Single Answer Question Which function is used to copy one string into another?
Correct Answer strcpy
Your Answer strcpy
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 , 200.000000
Your Answer 0 , 1.000000 , 101.000000
Select The Blank Question ________ writes characters to a file.
Correct Answer fputc
Your Answer fputc
Select The Blank Question ________ operator in C is used to perform the exponentiation operation.
Page 69 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer No
Your Answer No
Multiple Choice Multiple Answer Question Which of the following keywords are associated with switch statement?
Correct Answer case , default , break
Your Answer case , default , break
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
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
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 After goto, ________ has to be mentioned to pass the control.
Correct Answer label name
Your Answer label name
True/False Question Real falls under secondary constant
Correct Answer False
Your Answer False
Multiple Choice Multiple Answer
Page 70 of 109
SCDL – 3rd Semester – C - Programming
Question Which of the following statements are valid for C language?
Correct Answer one man language , developed in 1972
Your Answer one man language , developed in 1972
True/False Question There is no three dimensional array
Correct Answer False
Your Answer False
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
Select The Blank Question The address of a structure ________ be passed to a function.
Correct Answer can
Your Answer can
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
Select The Blank Question C uses ________ to check for any errors and to convert the code in machine language.
Correct Answer compiler
Your Answer compiler
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
Page 71 of 109
SCDL – 3rd Semester – C - Programming
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);}
Correct Answer memory address of a variable 'a'
Page 72 of 109
SCDL – 3rd Semester – C - Programming
Your Answer memory address of a variable 'a'
Multiple Choice Single Answer Question C can be used on
Correct Answer All the above
Your Answer All the above
Select The Blank Question ________ is a default mode of a file.
Correct Answer text
Your Answer text
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 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 If in recursive function 'if' statement is omitted, it causes to fall in ________.
Correct Answer an indefinite loop
Your Answer an indefinite loop
Multiple Choice Single Answer Question What is a string?
Correct Answer A character array
Your Answer A character array
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Select The Blank
Page 73 of 109
SCDL – 3rd Semester – C - Programming
Question: ________ operator is used to refer to the structure element, when structure pointer is declared Correct Answer: -> Your Answer: -> Select The BlankQuestion: 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 BlankQuestion: 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 AnswerQuestion: Which of the following is a unformatted console I/O function to display a string? Correct Answer: puts Your Answer: puts True/FalseQuestion: 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 BlankQuestion: Arithmatic operations can be performed on characters where their ________ value is used. Correct Answer: ASCII Your Answer: ASCII Select The BlankQuestion: The keyword ________ is followed by an interger or a character constant. Correct Answer: case Your Answer: case Match The FollowingQuestion 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 Multiple Choice Single AnswerQuestion: The collaboration diagram shows interaction between objects and sequence of activities denoted by :-
Page 74 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer: Members Your Answer: Methods Select The BlankQuestion: 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/FalseQuestion: 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 AnswerQuestion: The sequence diagram follows the following sequence :- Correct Answer: Use-case-transaction sequence Your Answer: Use-case-transaction sequence Multiple Choice Single AnswerQuestion: 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/FalseQuestion: Initialisation of the conditional variable is necessary for while loop. Correct Answer: True Your Answer: True Multiple Choice Single AnswerQuestion: What is the another name of 'value at address' operator? Correct Answer: indirection Your Answer: indirection True/FalseQuestion: If break is not used in cases, compiler gives an error. Correct Answer: False Your Answer: False Multiple Choice Single Answer
Page 75 of 109
SCDL – 3rd Semester – C - Programming
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 AnswerQuestion: 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 BlankQuestion: Booch emphasises development of mechanisms with ________ model. Correct Answer: Data Your Answer: Data True/FalseQuestion: The set of statements belongining to a function are enclosed within a pair of braces. Correct Answer: True Your Answer: True Select The BlankQuestion: ________ is a relation operator used to compare for equal values Correct Answer: == Your Answer: == Multiple Choice Single AnswerQuestion: Which of the following statements is decision making instruction? Correct Answer: if Your Answer: if Select The BlankQuestion: A structure can be used to ________ a floppy. Correct Answer: format Your Answer: read Multiple Choice Single AnswerQuestion: 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/FalseQuestion: In an array of structures all elements of the array are stored in adjacent memory locations. Correct Answer: True Your Answer: True True/FalseQuestion: puts() can display only one string at a time. Correct Answer: True Your Answer: False
Page 76 of 109
SCDL – 3rd Semester – C - Programming
Multiple Choice Single AnswerQuestion: The break statement is used to exit from:- Correct Answer: A for loop Your Answer: A for loop True/FalseQuestion: 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 AnswerQuestion: Which function is used to open a file? Correct Answer: fopen Your Answer: fopen Match The FollowingQuestion 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 AnswerQuestion: 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 AnswerQuestion: 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 AnswerQuestion: 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 BlankQuestion: ________ function appends first n characters of a string at the end of another Correct Answer: strncat Your Answer: strncat Multiple Choice Multiple Answer
Page 77 of 109
SCDL – 3rd Semester – C - Programming
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 BlankQuestion: 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/FalseQuestion: Once file is open it is always refered by its FILE pointer Correct Answer: True Your Answer: True True/FalseQuestion: 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 BlankQuestion ________ operator gives the size of the variable in bytes.Correct Answer sizeof()
Multiple Choice Single AnswerQuestion Which of the following is format specifier of a string?Correct Answer %s
Multiple Choice Multiple AnswerQuestion Which of the following modes are used to write to a file?Correct Answer w , w+ , a
True/FalseQuestion If the file is absent, fopen() returns NULL.Correct Answer True
Select The Blank
Page 78 of 109
SCDL – 3rd Semester – C - Programming
Question ________ is a person or device that uses the system.Correct Answer User
Select The BlankQuestion If in recursive function 'if' statement is omitted, it causes to fall in ________.Correct Answer an indefinite loop
Multiple Choice Single AnswerQuestion 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 outputCorrect Answer 1
Multiple Choice Single AnswerQuestion Which function is used to copy one string into another?Correct Answer strcpy
True/FalseQuestion Infinite loop is the loop which stops when the condtions is false.Correct Answer False
True/FalseQuestion argv is an array of pointers.Correct Answer True
True/FalseQuestion strdup() duplicates a string.Correct Answer True
Multiple Choice Single AnswerQuestion This funciton is used to convert a string to lowercase :-Correct Answer strlwr
True/FalseQuestion C program is nothing but a combination of functionsCorrect Answer TrueTrue/FalseQuestion When array is declared with rows and columns it is called as 2-D i.e. two dimensional arrayCorrect Answer True
Select The BlankQuestion Booch emphasises development of mechanisms with ________ model.Correct Answer Data
Multiple Choice Multiple AnswerQuestion Which of the following fuctions require a single string as a parameter?Correct Answer strlen , strlwr , strupr
Multiple Choice Multiple AnswerQuestion Which of the following keywords are associated with switch statement?Correct Answer case , default , break
Multiple Choice Multiple AnswerQuestion Which agruments are required for fgets()?Correct Answer address of the string , maximum length , file pointer
Multiple Choice Single AnswerQuestion Use case defines and describes what happens in the system in logical order. This is termed as :-Correct Answer System behaviour
Select The BlankQuestion ________ function sets all characters of string to a given character.
Page 79 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer strset
Multiple Choice Multiple AnswerQuestion 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 AnswerQuestion 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 AnswerQuestion Which of the following are control instructions in C?Correct Answer Sequence Control , Selection or Decision
Multiple Choice Single AnswerQuestion How many nesting of structures is possible?Correct Answer many
Select The BlankQuestion ________ is an input statement in CCorrect Answer scanf
Multiple Choice Single AnswerQuestion What is the another name of 'value at address' operator?Correct Answer indirection
Select The BlankQuestion Arithmatic operations can be performed on characters where their ________ value is used.Correct Answer ASCII
Multiple Choice Single AnswerQuestion 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 AnswerQuestion When array elements are passed to a function with their values, it is called as:-Correct Answer Call by value
True/FalseQuestion Only one comment can be given in a C programCorrect Answer False
Select The BlankQuestion ________ function is used to append one string at the end of anotherCorrect Answer strcat
Multiple Choice Single AnswerQuestion A function which is called is refered as :-Correct Answer called function
Multiple Choice Single AnswerQuestion if a is a float, the expression a = 5/9 will returnCorrect Answer 0.000000
Match The FollowingQuestion Correct Answer Your AnswerAccess Layer under OOA Objects whose role is to communicate to data
Page 80 of 109
SCDL – 3rd Semester – C - Programming
storage.Objects whose role is to communicate to datastorage.Layered architecture under TSD User interface tightly coupled with data User interface tightly coupled with dataBusiness Layer under OOA Objects that represent business with data andbehaviour.Objects that represent business with data andbehaviour.UI layer under OOA Objects with which user interacts. Objects with which user interacts.
Multiple Choice Single AnswerQuestion 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 BlankQuestion ________ is logical OR operatorCorrect Answer ||
Select The BlankQuestion ________ function copies a string into anotherCorrect Answer strcpy
True/FalseQuestion A pointer is a secondary constant.Correct Answer True
Multiple Choice Multiple AnswerQuestion 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 AnswerQuestion 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 AnswerQuestion 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/FalseQuestion A function can return only one value at a time.Correct Answer True
Select The BlankQuestion ________ creates a new file in low level.Correct Answer O_CREATE
Match The FollowingQuestion 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 AnswerQuestion Which of the following combinations in arithmetic operation give real result?Correct Answer real and real , integer and real
Page 81 of 109
SCDL – 3rd Semester – C - Programming
Multiple Choice Multiple AnswerQuestion 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/FalseQuestion 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 AnswerQuestion Which of the following operators have 1st priority in operations?Correct Answer * , / , %
Multiple Choice Multiple AnswerQuestion 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 AnswerQuestion 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 AnswerQuestion The command line arguments are :-Correct Answer argc , argv
Multiple Choice Single AnswerQuestion Maximum length of a character variable isCorrect Answer 1 character
Multiple Choice Single AnswerQuestion This function is used to compare first n characters of two strings :-Correct Answer strncmp
True/FalseQuestion The sequence diagram shows flow of behaviour and collaboration of objects.Correct Answer False
Multiple Choice Single AnswerQuestion If a is an integer variable, a = 5 / 2; will return a valueCorrect Answer 2
Multiple Choice Single AnswerQuestion Which function can accept a multi-word string?Correct Answer gets()
True/FalseQuestion The set of statements belongining to a function are enclosed within a pair of braces.Correct Answer True
Page 82 of 109
SCDL – 3rd Semester – C - Programming
True/FalseQuestion Standard I/O functions are nothing but stream I/O functions.Correct Answer True
Multiple Choice Single AnswerQuestion Studying system domain, identifying classes & objects with their properties and expressing them with eight notations/diagrams iscalled asCorrect Answer Object modeling of system.
Multiple Choice Single AnswerQuestion A sequence diagram shows an interaction arranged in time sequence in its :-Correct Answer Logical order
Multiple Choice Multiple AnswerQuestion 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 AnswerQuestion When an array has both rows and columns it is called as:-Correct Answer 2-D array , Matrix
Select The BlankQuestion In design phase ________ diagrams are refined to add more details with attributes and methods for implementation.Correct Answer Class
Select The BlankQuestion 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/FalseQuestion Functions are written to avoid rewriting the same section of code which requires oftenly.Correct Answer True
Multiple Choice Single AnswerQuestion 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/FalseQuestion In sense of time activity is longer and the action is relatively instantaneous.Correct Answer True
True/FalseQuestion The interaction diagrams are not good enough if behaviour of object is conditional and gets into a loop.Correct Answer True
Select The BlankQuestion ________models one or more roles that a user or a system interacting the system can play.Correct Answer Actor
Multiple Choice Multiple AnswerQuestion 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
Page 83 of 109
SCDL – 3rd Semester – C - Programming
True/FalseQuestion The value of the conditional variable should become false some time so that the loop can be terminated.Correct Answer True
Select The BlankQuestion ________ is used to terminate the program.Correct Answer exit
Select The BlankQuestion Array elements should be accessed using ________ if the elements are to be accessed in a fixed order.Correct Answer Pointers
Multiple Choice Multiple AnswerQuestion 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 BlankQuestion The link between the program and the operating systme is a structure called ________Correct Answer FILE
Multiple Choice Single AnswerQuestion A function in which another function is called is refered as :-Correct Answer calling function
Multiple Choice Single AnswerQuestion An array 'num' of integer type for 3 rows and 5 columns should be declared asCorrect Answer int num[3][5]
True/FalseQuestion scanf is used to accept the input from the user.Correct Answer True
Match The FollowingQuestion Correct Answer Your AnswerImplementation Model Converts design object model toimplementation model based on reusablecomponent technology.Converts design object model to implementationmodel based on reusable componenttechnology.Test Model Stipulates test strategy, test plans, testspecifications, test results and test recovaryreports.Stipulates test strategy, test plans, testspecifications, test results and test recovaryreports.Analysis Object Model Presents information how object model will beexecuted.Presents information how object model will beexecuted.Use case Model Defines actors inside and outside of use caseand their behaviour.Defines actors inside and outside of use caseand their behaviour.
Select The Blank
Page 84 of 109
SCDL – 3rd Semester – C - Programming
Question 'Recursive function' must have an ________ statement some where in the function.Correct Answer if
True/FalseQuestion Though the formal and actual argument names are same, they are treated as different variables.Correct Answer True
Multiple Choice Single AnswerQuestion In exponential form range of real constant the part that appears before 'e' is calledCorrect Answer mantissa
Multiple Choice Multiple AnswerQuestion Which operators are used to access the individual structure element.Correct Answer . , ->
Select The BlankQuestion ________ function sets first n characters of string to a given character.Correct Answer strnset
Multiple Choice Multiple AnswerQuestion Which of the following statements are valid for C language?Correct Answer one man language , developed in 1972
Multiple Choice Single AnswerQuestion What will be the output? main(){ int a=25, *b; b=&a; printf("%d",*b);}Correct Answer 25
Multiple Choice Multiple AnswerQuestion 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 FollowingQuestion Correct Answer Your AnswerAddress of the last element Always size of array - 1 Always size of array - 1Call by value in function Passing values of array elements Passing values of array elementsCall by reference in function Passing addressess of array elements Address of 1st element in an arrayBase address Address of 1st element in an array Used when call by refernce is done
Select The BlankQuestion ________ dimensional array can be thought of as an array of arrays of arrays.Correct Answer 3
Multiple Choice Single AnswerQuestion This funciton is used to convert a string to uppercase :-Correct Answer strupr
True/FalseQuestion Logical operators cannot be used with 'do' loop.Correct Answer False
Select The BlankQuestion ________ is logical AND operatorCorrect Answer &&
Select The BlankQuestion In case 'call by reference', the formal arguments of a function are always ________.Correct Answer pointer type
Multiple Choice Multiple AnswerQuestion Which of the following statements are not valid for C language?Correct Answer developed at Cambridge University , not a middle level language
Page 85 of 109
SCDL – 3rd Semester – C - Programming
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
Select The BlankQuestion ________ is one of the applications of a structure.Correct Answer Database Mgt.
Multiple Choice Single AnswerQuestion This function is used to compare two strings :-Correct Answer strcmp
Multiple Choice Multiple AnswerQuestion 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 FollowingQuestion Correct Answer Your Answerx*=10 = ( if x = 0 ) 0 incorrect operatorx++ = ( if x = 0 ) 1 1--x = ( if x = 0 ) -1 -1x+=5 = ( if x = 0) 5 5
Select The BlankQuestion There are basically ________ types of instrucitons in C.Correct Answer 4
Multiple Choice Single AnswerQuestion Which funciton is used to append first n characters of a string at the end of another?Correct Answer strncat
Multiple Choice Single AnswerQuestion If array is initialised while declaring :-Correct Answer Mentioning dimension is not complusory
Multiple Choice Multiple AnswerQuestion 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 AnswerQuestion Which of the following fuctions require at least two strings as a parameter?Correct Answer strcpy , strcat , strcmp
True/FalseQuestion A structure variable can be passed to a function.Correct Answer True
Multiple Choice Multiple AnswerQuestion 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 AnswerQuestion 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
Page 86 of 109
SCDL – 3rd Semester – C - Programming
Question Middle Level Language is the language which has both good programming efficiency and a good machine efficiencyCorrect Answer True
Multiple Choice Multiple AnswerQuestion 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 BlankQuestion C allows ________ variable(s) on left hand side of =.Correct Answer only one
Multiple Choice Single AnswerQuestion Which function is used to read characters from an array of characters?Correct Answer sscanf
Select The BlankQuestion In analytical phase ________ diagrams are achieved representing a system.Correct Answer Static
True/FalseQuestion stricmp compares two string ingnoring a case.Correct Answer True
True/FalseQuestion The use case may begin with no precondition or with some preconditions.Correct Answer True
Multiple Choice Multiple AnswerQuestion 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 BlankQuestion ________ operator is decrement operator by 1.Correct Answer --
Multiple Choice Single AnswerQuestion 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 BlankQuestion ________ is a valid statement to declare a character pointer c.Correct Answer char *c;
Multiple Choice Single AnswerQuestion A variable in C cannot start withCorrect Answer Both special symbol and a number
True/FalseQuestion An expression is the combination of variables, constants and operators as per the syntax of the languageCorrect Answer True
Multiple Choice Multiple AnswerQuestion 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
Page 87 of 109
SCDL – 3rd Semester – C - Programming
Match The FollowingQuestion Correct Answer Your Answeraddition(int,int); return an integer value which passes 2 integerargumentsreturn an integer value which passes 2 integerargumentsaddition(); an integer function with no arguments an integer function with no argumentsfloat addition(int, float); a float function having integer and float typeargumentsa float function having integer and float typeargumentschar addition(char,char); a char function having 2 arguments of chartypea char function having 2 arguments of char typeSelect The BlankQuestion The address of the zeroth element can also be passed by just passing the ________ of the array.Correct Answer Name
Select The BlankQuestion ________ opens a file for appending in low level.Correct Answer O_APPEND
True/FalseQuestion While passing an array elements to a function by call by reference we pass addresses of array elements to the functionCorrect Answer True
Multiple Choice Single AnswerQuestion The clarity of interaction diagram is lost with complex conditional behaviour. In such cases, the best designing tool is:Correct Answer Activity diagram
True/FalseQuestion The default prototype of any C function is 'int'.Correct Answer True
Multiple Choice Multiple AnswerQuestion Which of the following fuctions require number of characters as one of the parameters?Correct Answer strncmp , strnset , strncpy
Multiple Choice Single AnswerQuestion Class diagrams help to analyse the structure of system by identifying -Correct Answer Objects
True/FalseQuestion Array elements can not be passed to a function.Correct Answer False
Multiple Choice Single AnswerQuestion If a is an integer, the expression, a=7/ 22 * ( 3.14 + 2) * 3 /5 ; evaluates toCorrect Answer 0
Select The BlankQuestion ________ is a way to assign an address of variable a to pointer p.Correct Answer p = &a;
Select The BlankQuestion ________ instruction helps computer to execute a group of statements repeatedly.Correct Answer Loop control
Page 88 of 109
SCDL – 3rd Semester – C - Programming
Multiple Choice Multiple AnswerQuestion 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 AnswerQuestion Infinite loop is also called by another name. What is that?Correct Answer Odd
Select The BlankQuestion A structure can be used to ________ a floppy.Correct Answer format
True/FalseQuestion Control instructions are used to control the sequence of execution of various statements in programCorrect Answer True
Multiple Choice Multiple AnswerQuestion Which of the following are basic data types in C?Correct Answer int , float , char
Multiple Choice Single AnswerQuestion While accessing individual element of a structure, its element appears :-Correct Answer after '.' operator
Multiple Choice Multiple AnswerQuestion 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
Multiple Choice Multiple AnswerQuestion Which of the following commands are used for input/output operations?Correct Answer printf , scanf
True/FalseQuestion If file is too big, it gets loaded part by part.Correct Answer True
LIST OF ATTEMPTED QUESTIONS AND ANSWERS
1. Multiple Choice Single AnswerQuestion In logical AND :- Correct Answer Both the conditions have to be TRUE 2. Multiple Choice Multiple AnswerQuestion 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
Page 89 of 109
SCDL – 3rd Semester – C - Programming
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 AnswerQuestion Which of the following is not a character constant Correct Answer 'Thank You' 12. Multiple Choice Single AnswerQuestion 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 AnswerQuestion How many types are there of arguments? Correct Answer two 16. Multiple Choice Single AnswerQuestion 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 AnswerQuestion When the method is chosen and performed on the data, the object status changes. The static object assumes :- Correct Answer Dynamic state
Page 90 of 109
SCDL – 3rd Semester – C - Programming
19. True/False Question A constant is a quantity that doesn't change Correct Answer True 20. Multiple Choice Single AnswerQuestion 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 AnswerQuestion Opening a file establishes a link between :- Correct Answer the program , the operating system 23. Multiple Choice Single AnswerQuestion The collaboration diagram shows both :- Correct Answer Collaboration and sequence
24. Multiple Choice Single AnswerQuestion In exponential form range of real constant the part that appears before 'e' is called Correct Answer mantissa 25. True/False 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 AnswerQuestion A function which is called is refered as :- Correct Answer called function 31. Multiple Choice Single AnswerQuestion 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
Page 91 of 109
SCDL – 3rd Semester – C - Programming
Question ________ function compares first n characters of two strings without regard to case. Correct Answer strnicmp 34. Multiple Choice Single AnswerQuestion 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 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
Page 92 of 109
SCDL – 3rd Semester – C - Programming
Question Logical operator s cannot be used with 'do' loop. Correct Answer False
46. Multiple Choice Single AnswerQuestion 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 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
Page 93 of 109
SCDL – 3rd Semester – C - Programming
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 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
Page 94 of 109
SCDL – 3rd Semester – C - Programming
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 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 FollowingQuestion 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
Page 95 of 109
SCDL – 3rd Semester – C - Programming
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 FollowingQuestion Correct Answer Your Answer
^ No such operator No such operator
+ 2nd priority 2nd priority
* 1st priority 1st priority
= 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
Page 96 of 109
SCDL – 3rd Semester – C - Programming
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 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 BlankQuestion: Operation between ________ and integer always yields an integer result Correct Answer: an integer Your Answer: an integer
Select The BlankQuestion: ________ function is identical to strcmpi() Correct Answer: stricmp Your Answer: stricmp
Page 97 of 109
SCDL – 3rd Semester – C - Programming
Multiple Choice Multiple AnswerQuestion: 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/FalseQuestion: fputc() can be used to write to a VDU. Correct Answer: False Your Answer: True Multiple Choice Single AnswerQuestion: Class diagrams help to analyse the structure of system by identifying - Correct Answer: Objects Your Answer: Objects Select The BlankQuestion: Operation between an integer and real always yields ________ result Correct Answer: a real Your Answer: a real Multiple Choice Multiple AnswerQuestion: Which of the following operators have 1st priority in operations? Correct Answer: * , / , % Your Answer: * , / , % True/FalseQuestion: In sequence diagrams, the connection between objects is shown. Correct Answer: False Your Answer: True Multiple Choice Single AnswerQuestion: 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 AnswerQuestion: Which operator is used to refer to a structure element when pointer of structure is declared? Correct Answer: -> Your Answer: --> Select The BlankQuestion: An array of pointers is nothing but a ________. Correct Answer: Collection of addresses Your Answer: Collection of addresses Multiple Choice Multiple AnswerQuestion: 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 AnswerQuestion: 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
Page 98 of 109
SCDL – 3rd Semester – C - Programming
True/FalseQuestion: There are basically 5 types of instructions in C Correct Answer: False Your Answer: False Multiple Choice Single AnswerQuestion: 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 AnswerQuestion: 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 BlankQuestion: Any C statement ends with ________. Correct Answer: ; Your Answer: ; True/FalseQuestion: A variable is a name given to the location in memory where the constant is stored Correct Answer: True Your Answer: True True/FalseQuestion: If break is not used in cases, compiler gives an error. Correct Answer: False Your Answer: False True/FalseQuestion: 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 AnswerQuestion: 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 AnswerQuestion: Conversion of C programs into machine language is done with the help of Correct Answer: A Compiler Your Answer: A Compiler Multiple Choice Single AnswerQuestion: The language used by UA to develop Object Oriented systems is :- Correct Answer: UML Your Answer: UML Multiple Choice Multiple AnswerQuestion: 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
Page 99 of 109
SCDL – 3rd Semester – C - Programming
Question: The use case may begin with no precondition or with some preconditions. Correct Answer: True Your Answer: True Multiple Choice Multiple AnswerQuestion: Two dimensional array has :- Correct Answer: Rows , Columns Your Answer: Rows , Columns Multiple Choice Multiple AnswerQuestion: 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 AnswerQuestion: In case multiples statements are to be executed in if-block those have to be enclosed within :- Correct Answer: { } Your Answer: { } Select The BlankQuestion: In switch, ________ never have a constant to check. Correct Answer: default Your Answer: default Multiple Choice Single AnswerQuestion: Which is the ASCII value of End of file? Correct Answer: 26 Your Answer: 26 Select The BlankQuestion: ________ is a relation operator used to compare for unequal values Correct Answer: != Your Answer: != Multiple Choice Single AnswerQuestion: In which type, the values are passed to a function? Correct Answer: call by value Your Answer: call by value Select The BlankQuestion: ________ dimensional array has only rows Correct Answer: 1 Your Answer: 1 Multiple Choice Single AnswerQuestion: In logical NOT :- Correct Answer: No condition is to be TRUE Your Answer: No condition is to be TRUE
Multiple Choice Multiple AnswerQuestion: Which of the following operators have not 3rd priority in operations? Correct Answer: + , * , % Your Answer: + , * , % Multiple Choice Multiple AnswerQuestion: 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
Page 100 of 109
SCDL – 3rd Semester – C - Programming
Select The BlankQuestion: Operation between ________ and a real always yields a Real result Correct Answer: a Real Your Answer: a Real Multiple Choice Single AnswerQuestion: 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 BlankQuestion: The address of the zeroth element is also called as ________ Correct Answer: Base address Your Answer: Base address True/FalseQuestion: scanf is used to accept the input from the user. Correct Answer: True Your Answer: True Match The FollowingQuestion 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 AnswerQuestion: 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/FalseQuestion: 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 AnswerQuestion: 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/FalseQuestion: No pointer is possible to point a structure. Correct Answer: False Your Answer: False Match The FollowingQuestion Correct Answer Your Answer \r carriage return carriage return
Page 101 of 109
SCDL – 3rd Semester – C - Programming
\b backspace bakslash \f form feed form feed \t tab tab Multiple Choice Multiple AnswerQuestion: 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 AnswerQuestion: 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 garbageYour Answer: Unused elements will be filled with 0's or garbage Multiple Choice Single AnswerQuestion: 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 BlankQuestion: Operation between ________ and a real always yields a Real resultCorrect Answer: a RealYour Answer: a Real Select The BlankQuestion: ________ dimensional array has both rows and columnsCorrect Answer: 2Your Answer: 2 True/FalseQuestion: 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: TrueYour Answer: True
Multiple Choice Single AnswerQuestion: What is the limit on no. of functions in one C program :-Correct Answer: noYour Answer: 255 Match The FollowingQuestion 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 102 of 109
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 BlankQuestion: ________ is one of the applications of a structure.Correct Answer: Database Mgt.Your Answer: Database Mgt. True/FalseQuestion: An Integer is a Primary ConstantCorrect Answer: TrueYour Answer: True Multiple Choice Single AnswerQuestion: In this the condition is specified at the beginning of the loop :-Correct Answer: whileYour Answer: while True/FalseQuestion: Only one comment can be given in a C programCorrect Answer: FalseYour Answer: False True/FalseQuestion: If the value of a formal argument is changed in the called funciton, the corresponding changes take place in the calling funciton.Correct Answer: FalseYour Answer: False Multiple Choice Multiple AnswerQuestion: 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 AnswerQuestion: Which of the following operators have 1st priority in operations?Correct Answer: * , / , % Your Answer: * , / , % Multiple Choice Single AnswerQuestion: Maximum length of an Integer data type isCorrect Answer: -32767 to 32767Your Answer: 32767 True/FalseQuestion: Logical operators cannot be used with 'do' loop.Correct Answer: FalseYour Answer: False Multiple Choice Single AnswerQuestion: Which parameter needs to be passed with fgetc()?Correct Answer: FILE pointerYour Answer: First character in a file Select The BlankQuestion: The arguments that we pass on to main() at the command prompt are called ________ arguments.
Page 103 of 109
SCDL – 3rd Semester – C - Programming
Correct Answer: command lineYour Answer: command line Select The BlankQuestion: C allows ________ variable(s) on left hand side of =.Correct Answer: only oneYour Answer: only one Multiple Choice Multiple AnswerQuestion: 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 BlankQuestion: Break / continue is generally associated with ________.Correct Answer: ifYour Answer: while Multiple Choice Single AnswerQuestion: In this the condition is specified at the end of the loop :-Correct Answer: doYour Answer: do Multiple Choice Multiple AnswerQuestion: 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 BlankQuestion: The argument for the fflush() must be ________.Correct Answer: bufferYour Answer: argv[0] Select The BlankQuestion: There are as many as ________ odd operators in C which can affect the evaluation of an expession in subtle and unexpected waysCorrect Answer: 45Your Answer: 45 Select The BlankQuestion: There are basically ________ types of instrucitons in C.Correct Answer: 4Your Answer: 6 Multiple Choice Single AnswerQuestion: 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 goalsYour Answer: To split the use cases into smaller activities or tasks with specifi goals Multiple Choice Single AnswerQuestion: In logical NOT :-Correct Answer: No condition is to be TRUEYour Answer: No condition is to be TRUE Multiple Choice Multiple AnswerQuestion: 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
Page 104 of 109
SCDL – 3rd Semester – C - Programming
True/FalseQuestion: Standard I/O functions are nothing but stream I/O functions.Correct Answer: TrueYour Answer: True Multiple Choice Single AnswerQuestion: The unified approach [ UA ] is used to buildCorrect Answer: Object Oriented systemYour Answer: Object Oriented system Multiple Choice Single AnswerQuestion: Which of the following is a format specifier to display the address of a variable?Correct Answer: %uYour Answer: %u Multiple Choice Multiple AnswerQuestion: 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/FalseQuestion: switch requires an integer expression.Correct Answer: TrueYour Answer: True Select The BlankQuestion: ________ dimensional array can be thought of as an array of arrays of arrays.Correct Answer: 3Your Answer: 3 Multiple Choice Multiple AnswerQuestion: 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 AnswerQuestion: 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 AnswerQuestion: 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 BlankQuestion: ________models one or more roles that a user or a system interacting the system can play.Correct Answer: ActorYour Answer: Actor Multiple Choice Single AnswerQuestion: Which is the ASCII value of End of file?Correct Answer: 26Your Answer: 26 Multiple Choice Multiple Answer
Page 105 of 109
SCDL – 3rd Semester – C - Programming
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/FalseQuestion: The values of a structure varialbe cannot be assigned to another structure variable of the same type.Correct Answer: FalseYour Answer: False True/FalseQuestion: When array is declared with rows and columns it is called as 2-D i.e. two dimensional arrayCorrect Answer: TrueYour Answer: True Match The FollowingQuestion 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 AnswerQuestion: 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 AnswerQuestion: Which of the following are not control instructions in C?Correct Answer: Input/ Output , Arithmetic Your Answer: Input/ Output , Arithmetic True/FalseQuestion: Structure and union are primary constantsCorrect Answer: FalseYour Answer: False
[I] Multiple Choice Single Answer:1) Find error if any: main() { int a=20, *j; j=&a; printf(“%d”,j); }
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)
Page 106 of 109
SCDL – 3rd Semester – C - Programming
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:=> 108) 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? 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 ( )
Page 107 of 109
SCDL – 3rd Semester – C - Programming
{ 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 , argv19) 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?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 languageAns:=> True
27) Maximum length of a character variable is 1 characterAns: True
28) & operator prints the address of the variable.
Page 108 of 109
SCDL – 3rd Semester – C - Programming
29) empty () after main is not necessary
[IV] Fill in the Blanks:30) Arithmatic operations can be performed on characters where their ________ value is usedAns:=> ASCII
31) ________ is logical AND operatorAns:=> &&
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 %c3) double %lf4) float %f
%iNew line escape sequence
40) 1) \r carriage return 2) \b backspace 3) \f form feed 4) \t tab
Page 109 of 109