[go: up one dir, main page]

0% found this document useful (0 votes)
26 views10 pages

Sample Question Bank_C

H

Uploaded by

maharsh996
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views10 pages

Sample Question Bank_C

H

Uploaded by

maharsh996
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Course Code:202000110 Sample Question Bank Course Title:Programming with C

Multiple Choice Questions

1. __________is a step by step approach to solve any problem.


(a) Process (b) Programming Language (c) Algorithm (d) Compiler
2. __________is a pictorial representation of an algorithm.
(a) Data Diagram (b) Flow Chat (c) Pie Chart (d) Program
3. The process of walking through a program’s logic on paper before you actually write the program is
called ______________.
(a) desk checking (b) flowcharting (c) pseudocoding (d) testing
4. What symbol is used to represent output in a flowchart?
(a) square (b) circle (c) parallelogram (d) triangle
5. What is the standard decision symbol for a flowchart?
(a) circle (b) lozenge (c) diamond (d) square

Short Questions (for 2 Marks)


1. What is an algorithm? List Characteristics of an algorithm.
2. Write advantages and disadvantages of an algorithm.
3. Write an algorithm/flowchart for following.
a. To find simple interest. Hint: SI = (P * R * N)/100
b. To find maximum of given three numbers.
c. To find out N! (Factorial of N).
d. To find weather given number is odd or even.
4. What is flowchart? List Symbols used in flowchart.
5. Write advantages and disadvantages of flow chart.
6. List symbols used to draw flow chart. Explain any one.
7. List Rules to draw flow chart.

Long Questions (for 4/8 marks)


1. What is an algorithm? Write advantages and disadvantages of an algorithm. (4 marks)
2. Write an algorithm/flowchart for following. (each of 4 marks)
a. To find sum of odd value and even value digits of a given number.
b. To find out minimum from N numbers.
c. To check whether inputted number is prime number or not.
d. To check whether inputted number is palindrome number or not.
e. To check whether inputted number is Armstrong number or not.
f. To print N terms of Fibonacci series.
g. Sum=12 + 22 + 32 + 42 + 52 + 62 + 72 + … and so on.
3. What is Flowchart? Explain Rules to draw flowchart. Also explain symbols used to draw flowchart.
(8 marks)
4. What is flow chart? Write advantages and disadvantages of flowchart. (4 marks)
5. What is flow chart? Explain symbols used to draw a flow chart.

Compiled by: Prof Sheetal Macwan -1-


Course Code:202000110 Sample Question Bank Course Title:Programming with C

Multiple Choice Questions

1. Mnemonic a memory trick is used in which of the following language?


(a) Machine Language (b) Assembly Language (c) High Level Language (d) None of above
2. The translator program used in assembly language is called __________.
(a) Compiler (b) Interpreter (c) Assembler (d) Translator
3. __________ is easily relocatable language.
(a) Machine Language (b) Assembly Language (c) High Level Language (d) Medium Level
Language
4. Which of the following is called low level languages?
(a) Machine Language (b) Assembly Language (c) Both of the above (d) None of above
5. Which of the following is problem oriented language?
(a) High level language (b) Machine language (c) Assembly language (d) Low level language
6. A compiler is a translating program which
(a) Translates instruction of a high level language into machine language
(b) Translates entire source program into machine language program|
(c) It is not involved in program’s execution
(d) All of above
7. Which of the following is machine independence program?
(a) High level language (b) Machine language (c) Assembly language (d) Low level language
8. Which is the limitation of high level language?
(a) Lower efficiency (b) Machine dependence (c) Machine level coding (d) None of above
9. High level language is also called _______________
(a) Problem Oriented Language (b) Business Oriented Language (c) Mathematically Oriented
Language (d) All of above
10. C language is _______________
(a) High level language (b) Machine language (c) Assembly language (d) Low level language

Short Questions (for 2 Marks)


1. What is an Editor? Give 3 examples of Well Know Editors.
2. List Languages for all generation.
3. Write advantages and disadvantages for following.
a. Machine Level or Low Level Language (1GL)
b. Assembly Language (2GL)
c. High Level Language (3GL)
4. What is Translator? List all translators.
5. Explain any one translator in detail.

Long Questions (for 4/8 marks)


1. What is Translator? Explain compiler, Interpreter and Assembler. ( 8 Marks)
2. Explain High Level Language and Assembly Language in Detail. ( 8 Marks)
3. Write a note on Language Generation. (4 Marks)
4. Explain any one language from following in detail. (Each contain 4 Marks)
a. Machine Level or Low Level Language (1GL)
b. Assembly Language (2GL)
c. High Level Language (3GL)
5. Write difference between Interpreter and Compiler.

Compiled by: Prof Sheetal Macwan -2-


Course Code:202000110 Sample Question Bank Course Title:Programming with C

Multiple Choice Questions


1 _________________ is a valid variable name.
a) int b) float 3) tot_sum 4) 9Sum
2 In which section consists of Header files.
a) Main() 2) Definition 3) Documentation 4) Link Section
3 _________________ is a invalid variable name.
a) INT b) pi c) int marks d) total_marks
4 What is the output of 9/2- (5%3)
a) 2 b) -2 c) 0 d) 3
5 The range of int data type is _______ bytes.
a) 2 b) 4 c) 8 d) 16
6 What is the value of I after the following execution?
I=1; ++I =+ 3;
a) 2 b) 5 c) 1 d) 0
7 The value can be changed during program execution is known as ________.
a) Variable b) constant c) Operator d) None of these
8 The combination of ? and : is known as ____________ operator.
a) Ternary b) Arithmetic c) dot d) Relational
9 The value can not be changed during program execution is known as ________.
a) Variable b) constant c) Operator d) None of these
10 __________ format specifier used for floating data type.
a) %d b) %f c) %c d) %e
11 Which of the following section is compulsory in C program?
a) Main() 2) Definition 3) Documentation 4) None of these
12 By default __________ digits in float type variable after decimal point.
a) 2 b) 4 c) 6 d) 8
13 Which of the following backslash character constant is used for horizontal tab?
a) \n b) \t c) \h d) \y
14 __________ format specifier used for integer data type.
a) %d b) %f c) %c d) %e
15 The range of double data type is _______ bytes.
a) 2 b) 4 c) 8 d) 16

Short Question ( 2 marks)


Draw the basic structure of C program.
2 Write Rules of variable name.
3 Explain printf() statement with example.
4 Explain scanf() statement with example.
5 Explain ternary operator with example.
6 Explain short hand operator in brief.
7 Write difference between pre-increment and post- increment operator.

Long Questions. ( 4/8 Marks)


1 Explain Basic Structure of C program.
2 What is operator? Explain different operators with example.
3 Explain Arithmetic operator & Relational operator with example.
4 Explain Relational and Pre and post increment operator with example.
5 What is Variable? How to declare and initialization of variable with example.
6 Explain basic data types used in C language.
7 What is the output for following?
a) 4/3 % 9-3 b) (-7/3)+4%3/7 c) 8/4.0+(3.0/2)-1 d) 10/5-2*(3%6)
e) ((3/2)*6/2-1) f) 7/2+(4.0*3)%2
Compiled by: Prof Sheetal Macwan -3-
Course Code:202000110 Sample Question Bank Course Title:Programming with C

Multiple Choice Questions

1 i=10;
j=++i;
i++;
then i=_____ and j=_______

(a) 21, 22 (b) 25, 21 (c) 22, 32 (d) 12, 11


2 Do-while loop is also known as _________ loop.
(a) Entry level (b) Exit level (c) a &b (d) None of this
3 _______ statement terminates the execution of loop.
(a) Continue (b) break (c) switch (d) none of these
4 _______ statement skips the remaining statement of the loop and control transfer to the
condition.
(a) Break (b) Continue (c) if (d) switch
5 The Switch expression can be an ______ type.
(a) Integer (b) float (c) double (d) none of these
6 The following is not true for switch statement.
a) break is optional in switch;
b) default is optional in switch;
c) we can define same case label more than once;
d) we can define switch within another switch;
7 __________loop execute at least once.
a) while loop b) do...while c) if d) for

8 While (1)
{
printf(“ Hello”);
}
How many times execute above loop?
a) 1 b) 10 c) infinite time d) finite time
9 Identified from the following after which statement; is required.
a) for b) nested if c) continue d) none of these
10 ___________ types of control structure available in C language.
a) 1 b) 2 c) 3 d) 4

Short Questions (2 Marks)


1 Explain if statement with example.
2 Explain break and continue statement in C.
3 Explain do-while statement with example.
4 Explain break statement with example.
5 Write difference between break and continue.
6 Write difference between exit and entry controlled loop.
7 Explain structure programming in brief.

Long Questions ( 4/8 Marks)


1 Explain if..else & nested if statement with syntax and example.
2 Explain switch statement with syntax and example.
3 Explain looping statement with syntax and example.
4 Explain while and for loop with syntax and example.
5 Write difference between do-while, while and for loop.

Compiled by: Prof Sheetal Macwan -4-


Course Code:202000110 Sample Question Bank Course Title:Programming with C

Multiple Choice Questions


1 For declaring one- dimensional array __________subscript is use.
1) One 2) Two
3) Three 4) All of above
2 Individual value in array is called _____________
1) Element 2) Number
3) Index 4) Element and number
3 For declaring two- dimensional array __________subscript is use.
1) One 2) Two
3) Three 4) All above
4 In Array subscript can begin with number_____________
1) Zero 2) One
3) Three 4) None of these.
5 When we declare array _______________data type is use.
1) int 2) char
3) float 4) All of above
6 For Initialization of array list of value separated by _________________
1) Question marks ( ? ) 2) Commas ( , )
3) Exclamatory marks (!) 4) None of these
7 An array can be initialize either at compile time or at _________
1) Run Time 3) Allocation Time
3) Released Time 4) Not of above
8 ‘\0’ is ________________
1) Null Character 2) Character value
3) Escape sequence 4) Symbolic Constant
9 In two dimensional array the first subscript is define ____________size.
1) Row 2) column
3) Vector 4) All of above
10 In two dimensional array the second subscript is define ____________size.
1) Row 2) column
3) Vector 4) All of above
11 A group of character is known as _____________
1) String 2) Array
3) Function 4) All of above
12 When we declare string _______________data type is use.
1) int 2) char
3) float 4) All of above
13 A group of character in string defines in__________________quotation marks.
1) Single 2) Double
3) Three 4) Multi
14 _____________is use to print the double quote in the string
1) Back slash 2) Forward slash
3) Tab 4) None of these.
15 __________________operation is performed on string
1) Reading 2) Copying
3) Writing 4) All of above.
16 _____________function is use to reading the string
1) scanf() 2) printf()
3) strrev() 4) strlen()
17 _____________function is use to writing the string.
1) scanf() 2) printf()
3) strrev() 4) strlen()

18 Ampersand (&) is not required when read the _______________value.


Compiled by: Prof Sheetal Macwan -5-
Course Code:202000110 Sample Question Bank Course Title:Programming with C

1) int 2) float
3) string 4) All of above.
19 Reading a specified number of character from the input string ___________is use in scanf
Function.
1) %d 2) %S
3) %ws(w=number) 4) %ld
20 Reading single character form the keyboard __________________function is use.
1) putchar( ) 2) getchar()
3) getc() 3) putc()
21 ________function is use for reading the string with the whitespace.
1) gets() 2) puts()
3) getc() 3) putc()
22 gets () function is available in _____________header file.
1) <stdio.h> 2) <conio.h>
3) <math.h> 4) All of above
23 The function putchar ( ) requires ____________parameter.
1) One 2) Two
3) Three 4) Four
24 puts () function is available in _____________header file.
1) <stdio.h> 2) <conio.h>
3) <math.h> 4) All of above
25 What is the O/P of the following code in arithmetic code on character?
x = ‘z’-1;
1) x = 121 2) x = 125
3) x = 112 4) None of these
26 The ______________string function is use to joins two string.
1) strcat() 2) strlen()
3) strupr() 4) strrev()
27 If both the string are same then the comparison value is ___________
1) Zero 1) One
3) Minus One 4) None of these
28 strcmp () function is use for __________ two string.
1) Concate 2) Join
3) Compare 4) All of above
29 strcmp(“ABCD”,”abcd”) = _________________
1) 0 2) 32
3)-32 4) -1
30 strcpy () function works like ____________operator.
1) assignment 2) logical
3) bit-wise 4) relational
31 Assign the value of one string into another string ____________function is use.
1) strcpy() 2) strlen()
3) strupr() 4) strrev()
32 _________ function count and return the number of character in a string.
1) strcpy() 2) strlen()
3) strupr() 4) strrev()
33 _____________function is use for reverse the string.
1) strcpy() 2) strlen()
3) strupr() 4) strrev()
34 Command line argument : main(int argc ,char *argv[])Consider the above example the
_______________variable is count the number of argument in command line.
1) argc 2) argv
3) int 4) main( )

Compiled by: Prof Sheetal Macwan -6-


Course Code:202000110 Sample Question Bank Course Title:Programming with C

Short Questions ( 2 Marks)

1. What is array? List out the type of array use in c programming.


2. What is an array? Write syntax to declare 1D array in c. also give one example.
3. Write the syntax of compile time initialization of 1D array in c.Also give example.
4. Write the syntax of run time initialization of 1D array in c.Also give example.
5. What is an array? Write syntax to declare 2D array in c. also give one example.
6. Write the syntax of compile time initialization of 2D array in c.Also give example.
7. Write the syntax of run time initialization of 2D array in c.Also give example.
8. What is string? List out the operation perform on the string.
9. What is string? Write the syntax of declaring string in c.Also give example.
10. What is string? How we can initialize the string variable. give one example.
11. Explain gets ( ) function with syntax and example.
12. Explain puts ( ) function with syntax and example.
13. Explain strlen ( ) function with syntax and example.
14. Explain strrev ( ) function with syntax and example.
15. Explain strcmp ( ) function with syntax and example.
16. Explain strcpy ( ) function with syntax and example.
17. Explain strcat ( ) function with syntax and example.

Long Questions (4/8 Marks)

1. Define array? Also explain declaration of 1D and 2D array with syntax and example.
2. Explain initialization of 1D array with syntax and example.
3. Explain initialization of 2D array with syntax and example.
4. Explain arithmetic operation in character with example.
5. Explain gets and puts function with syntax and example.
6. Explain command line argument in c with example.
7. Define 1D array? Explain the declaration and initialization of 1D array with syntax and example.
8. Define 2D array? Explain the declaration and initialization of 2D array with syntax and example.
9. Explain following function with syntax and example.
1 ) strlen ( ) 2) strcat ( )
3) strcpy ( ) 4) strrev ( )
10. Explain following function with syntax and example.
1) strcmp ( ) 2) gets ( )
3) puts ( ) 4) strrev ( )

Compiled by: Prof Sheetal Macwan -7-


Course Code:202000110 Sample Question Bank Course Title:Programming with C

Multiple Choice Questions


1 Every c program begins its execution with ________________
1) { 2) clrscr ( )
3) main ( ) 4) #include<stdio.h>
2 The following are the user define function ______________.
1) main ( ) 2) printf ( )
3) scanf ( ) 4) sqrt ( )
3 printf ( ) and scanf ( ) is __________type of function.
1) Library 2) User-define
3) main 4) None of above
4 C function can be classified in ____________catagory.
1) one 2) two
3) three 4) nine
5 All function by default return ______________
1) integer 2) float
3) void 4) string
6 Function header consists of __________parts.
1) one 2) two
3) three 4) none of above
7 A function definition is also known as _________________.
1) function implementation 2) function call
3) function type 4) none of above.
8 The parameter is also known as __________________
1) argument 2) variable
3) data type 4) array
9 A parameter list in function can be separated by______________
1) Question marks ( ? ) 2) Commas ( , )
3) Exclamatory marks (!) 4) None of these
10 A function can be surrounded by ______________
1) parentheses 2) square brackets
3) queerly brackets 4) none of these
11 The following are wrong declaration in function definition.________________
1) int sum(int a , float b) 2 ) float sum( int a ,float b)
3) int sum( int a,b) 4) float sum(float a, float aa)
12 A ___________statement that returns the value evaluated by the function.
1) goto 2) break
3) return 4) none of these
13 When the function return any value at that time it return ______value per function call.
1) one 2) two
3) three 4) multiple
14 When the function is called ______________argument is pass.
1) actual 2) formal
3) actual & formal 4) none of these
15 A function declaration is also known as _______________
1) function implementation 2) function call
3) function type 4) function prototype.
16 If the function has no formal parameter ,the list is written as _________
1) ( void ) 2) ( int )
3) ( float ) 4) none of these
17 The return type must be _________if no value return from the function.
1) void 2) int
3) float 4) none of these.

Compiled by: Prof Sheetal Macwan -8-


Course Code:202000110 Sample Question Bank Course Title:Programming with C

18 If the function are declare in the global declaration section the prototype is referred
as ____________________prototyped.
1) global 2) local
3) formal 4) none of these
19 If the function are declare in the local declaration section the prototype is referred
as ____________________prototyped.
1) global 2) local
3) formal 4) none of these
20 User Defined Function can be classified in to ___________category.
1) one 2) two
3) three 4) four
21 isdigit( ) function is available in _____________________
1) <stirng.h> 2) <ctype.h>
3) <conio.h> 4) <math.h>
22 Abs ( ) function is available in _____________________
1) <stirng.h> 2) <stdlib.h>
3) <conio.h> 4) <math.h>
23 ______________is return the absolute value.
1) abs( ) 2) isdigit( )
3) isupper( ) 4) islower( )
24 isalpha( argument ) function is return ________________ where the argument is not alphabetic
1) zero 2) one
3) three 4) none of these
25 isupper( ) function is available in _____________________
1) <stirng.h> 2) <ctype.h>
3) <conio.h> 4) <math.h>

Short Questions ( 2 Marks)

1 Define function? List out type of function use in c.


2 What is user – define function? Give one example of user define function.
3 What is library function? Give one example of library function.
4 Write deference between user define function and library function.
5 Write the advantage of function.
6 Define function? List out typed of element of user define function.
7 Write the syntax of the following.
1) Function definition.
2) Function call
3) Function declaration.
8 Define function? List out the category of function.
9 List out any four mathematical functions.
10 Explain the isalpha ( ) function.
11 Explain the isdigit ( ) function.
12 Explain the islower ( ) function.
13 Explain the isupper ( ) function.
14 Explain the pow ( ) function.
15 Explain the sqrt ( ) function.
16 Explain the abs ( ) function.
17 Explain the clrscr ( ) function.
18 Explain the getch ( ) function.

Compiled by: Prof Sheetal Macwan -9-


Course Code:202000110 Sample Question Bank Course Title:Programming with C

Long Questions (4/8 Mark)

1 Define function? Explain type of function use in c with example.


2 Explain function definition with syntax and example
3 Explain function call with syntax and example
4 Explain function declaration with syntax and example

5 Explain formal parameter and actual parameter with example.


6 Explain return statement with syntax and example. And also explain the return type in
C language
7 Explain the function category with no argument and no return value with example.
8 Explain the function category with argument and no return value with example.
9 Explain the function category with no argument and return value with example.
10 Explain the function category with argument and return value with example.
11 What is user define function? Explain element of user define function.
12 Explain the following category of function with example
1 ) no argument & no return value 2) with argument & no return value
13 Explain the following category of function with example
1 ) no argument & with return value 2) with argument & with return value
14 Explain the following library function with syntax and example
1) sqrt ( ) 2) isdigit ( )
3) pow ( ) 4) islower ( )
15 Explain the following library function with syntax and example
1) abs ( ) 2) isalpha ( )
3) clrscr ( ) 4) isupper ( )

Compiled by: Prof Sheetal Macwan - 10 -

You might also like