[go: up one dir, main page]

0% found this document useful (0 votes)
12 views13 pages

C Question Bank

The document outlines a question paper for a BTECH course in BASIC COMPUTATION AND PRINCIPLES OF COMPUTER PROGRAMMING, detailing various types of questions including MCQs, short answer questions, subjective questions, and broad questions across multiple topics. It includes sections on MCQs related to computer fundamentals, C programming, flow control, functions, arrays, and pointers, along with specific question formats and marks allocation. Additionally, it provides details about the paper setter and the course structure.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views13 pages

C Question Bank

The document outlines a question paper for a BTECH course in BASIC COMPUTATION AND PRINCIPLES OF COMPUTER PROGRAMMING, detailing various types of questions including MCQs, short answer questions, subjective questions, and broad questions across multiple topics. It includes sections on MCQs related to computer fundamentals, C programming, flow control, functions, arrays, and pointers, along with specific question formats and marks allocation. Additionally, it provides details about the paper setter and the course structure.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Question Paper Details

Course Stream Semester Subject Paper Chapter


Code
BTECH !st Year 2nd BASIC CS201 ALL
COMPUTATION
AND
PRINCIPLES OF
COMPUTER
PROGRAMMING

Paper Setter Details

Name Designation Mobile No Email id

Pallabi Assistant 9830453398 pallabi2007@gmail.com


Chakraborty Professor

MCQ(Type 1) Marks:- 1

1-Which of the following retains the information it’s storing when the power to the system is
turned off?
(A) CPU
(B) ROM
(C) RAM
(D) DIMM
2. Which of the following memories must be refreshed many times per second?
(A) Static RAM
(B) Dynamic RAM
(C) EPROM
(D) ROM
3. The octal number 645 in power of 8 is equal to
a) 450
b) 451
c) 421
d) 501

4. Convert (0.345)10 in to an octal number.


a) (0.1605)8
b) (0.2605)8
c) (0.1945)8
d) (0.2404)8
5. Convert from binary to decimal: (01011.1011)2 = ?
a) (11.6875)10
b) (11.5874)10
c) (10.9876)10
d) (10.7893)10
6. Octal to binary conversion: (24)8 = ?
a) (111101)2
b) (010100)2
c) (111100)2
d) (101010)2
7. Convert binary to octal: (110110001010)2 = ?
a) (5512)8
b) (6612)8
c) (4532)8
d) (6745)8

Short Question (Type 2): Marks:-2


1. Explain two input Exclusive NOR gate using truth table.
2. Why NOR gate is called universal gate?
3. Convert (45.5675)10 to hexadecimal.
4. What are the advantages of 2’s complement over 1’s complement?
5. Convert (11110101.110011)2 to decimal.

Subjective Question(Type3) Marks:-3


1. What is the difference between RAM and ROM?
2. What is the difference between compiler and interpreter?
3. What is 2’s complement? Give example
4. Why NAND gate and NOR gate are called universal gate?
5. Is it possible to realize a digital computer without a primary memory?

Broad question (Type 4) Marks:-5


1. Draw a block diagram of a computer and briefly explain its components.
2. Simplify (A+B’).(A.C)+(A.B’+A’.C).(A+B)’
3. If K bytes are required to store a number in hexadecimal number system, find how many bytes
will be required to store the number in binary number system.
4. Covert the following
i) (2AD)16=()2?
ii) (25.125)10=()2?
5. Represent the following expression using logic gates
S=(AX+BY)+(CD+EF)
6. Using 2’s complement system perform (5510-3410).

C Fundamentals and Operators & Expressions


MCQ(Type 1) Marks:- 1

1. Which of the following are tokens in C?

A] Keywords

B]Variables

C]Constants

D]All of the above

2. What is the valid range of numbers for int type of data?

A] 0 to 256

B] -32768 to +32767

C] -65536 to +65536

D] No specific range

3. What will be the maximum size of a float variable?

A] 1 byte

B] 2 bytes

C] 4 bytes

D] 8 bytes

4. The operator && is an example for ___ operator.

A] Assignment

B] Increment

C] Logical

D] Rational

5. The operator & is used for

A] Bitwise AND

B] Bitwise OR

C] Logical AND
D] Logical OR

6. Which of the following is a ternary operator?

A] ?

B] *

C] sizeof

D]^

7. The type cast operator is

A] (type)

B] cast()

C] //

D] “ “

8. Which is not keyword in ‘C’ ?

A]typedef

B] const

C] near

D] complex

Short Question (Type 2): Marks:-2


1. What is variable?

2. What is constant?

3. How many bytes are required to store integer type value?

4. How many bytes are required to store float type value?

5. How many bytes are required to store char type value?

6. How many bytes are required to store double type value?

7. What is main difference between variable and constant?

8. Give the general syntax of conditional operator?

9. Which are relational operators?

10. Which are logical Operators?


11. Which are Bitwise Operators?

Subjective Question(Type3) Marks:-3


1. Explain different data types used in C language?

2. What is variable? What are the rules for defining variables?

3. Explain type identifiers in C?

4. Explain in brief structure of C programming?

5. What is operator enlist all operators used in C?

6. What is data type explain the any four data types used in C language?

7. Explain the difference between ‘=’ and ‘==’ operator explain with example?

8. Differentiate between relational and logical operators used in C?

9. Write short note on Input & Output functions used in C (i.e. printf &scanf functions?

10. Explain with example ++i and i++.

Broad question (Type 4) Marks:-5


1. Describe all operators used in C language with example.

2. State and explain formatted input-output statements and standard input-output

Statements with example.

3. Explain the difference between float, char and int data type with suitable example.

4. Write a c Program to Add Two Integers.

5. Write a program to read two floating point numbers. Add these numbers and assign

the result to an integer. Finally display the value of all the three variables.’

6. Write a program to calculate simple and compound interest.

7. Write a program to evaluate area of triangle using the formula sqrt(s(s-a)(s-b)(s-c)).

8. Write a program to swap two numbers.


Flow of Control
MCQ(Type 1) Marks:- 1

1. Which loop is most suitable to first perform the operation and then test the condition?
a) for loop
b) while loop
c) do-while loop
d) none of the mentioned
2. Which keyword can be used for coming out of recursion?
a) break
b) return
c) exit
d) Both break and return
3. Which of the following is an invalid if-else statement?
a) if (if (a == 1)){}
b) if (func1 (a)){}
c) if (a){}
d) if ((char) a){}
4. C supports how many basic looping constructs
A] 2
B] 3
C] 4
D] 6
5. Which of the following cannot be checked in a switch-case statement?
a)Character
b)integer
c)float,
d)enum
Short Question (Type 2): Marks:-2
1. What is nested loop?
2. What is use of if statement?
3. Write a syntax of while loop? Give Example.
4. What is do-while statement?
5. Write a syntax of for loop? Give Example.

Subjective Question(Type3) Marks:-3


1.Which looping statements does C provides?Explain any one.
2. Explain explain continue And break statements
3. Explain switch statement with its syntax and example.
4. What is Nested if else explain with an example?
5. Explain nested for loop with an example.
6. What is the difference between while loop and do-while loop?
Broad question (Type 4) Marks:-5
1. What is use of continue in C.
2. What is looping in C? What are the advantages of looping?
3. Compare while loop and for loop with example.
4. Explain the following using general syntax and example.
i) if ii) if-else iii) nested if-else
5. Write a program for finding the factorial of a given number using do while statement.
6. Write a program for printing all prime numbers upto N numbers.
7. Write a program for finding the total number of even integers and odd integers of
‘N’ numbers.

Fundamentals and Program Structures


MCQ(Type 1) Marks:- 1

1. Which of the following is a correct format for declaration of function?


a) return-type function-name(argument type);
b) return-type function-name(argument type)
{}
c) return-type (argument type)function-name;
d) all of the mentioned

2. Which of the following function declaration is illegal?


a) int 1bhk(int);
b) int 1bhk(int a);
c) int 2bhk(int*, int []);
d) all of the mentioned
3. Which function definition will run correctly?
a) int sum(int a, int b)
return (a + b);
b) int sum(int a, int b)
{return (a + b);}
c) int sum(a, b)
return (a + b);
d) none of the mentioned

4. Can we use a function as a parameter of another function? [ Eg: void wow(int func()) ].
a) Yes, and we can use the function value conveniently
b) Yes, but we call the function again to get the value, not as convenient as in using variable
c) No, C does not support it
d) This case is compiler dependent
5. The value obtained in the function is given back to main by using ________ keyword?
a) return
b) static
c) new
d) volatile

6. What is the return-type of the function sqrt()


a) int
b) float
c) double
d) depends on the data type of the parameter

7. What is the default return type if it is not specified in function definition?


a) void
b) int
c) double
d) short int

8. functions can return structure in c?


a) true
b) false
c) Depends on the compiler
d) Depends on the standard

9. Global variables are:


a) Internal
b) External
c) Both Internal and External
d) None of the mentioned

Short Question (Type 2): Marks:-2


1. What is function?
2. What is built in function?
3. What is use of return statement?
4. What is logical variable?
5. What is global variable?
6. What is recursive function?
7. What do you mean by call by value?
8. What do you mean by call by reference?
Subjective Question(Type3) Marks:-3
1. Differentiate between local variable and global variable?
2. What is the difference between call by value and call by reference?
3. What is recursion explain with suitable example.
4. Explain Automatic storage class specifier
5. Explain Static storage classs
6. Explain Register storage class
7. Explain Extern storage class
8. For what purpose ‘\0’ is used in string operations explain with suitable example.
9. What is function ?how function is defined.
10. Explain the difference between calling function and called function?
11. Explain void function?

Broad question (Type 4) Marks:-5


1. Write a short note on C preprocessors
2. Explain features of preprocessors
3. What is user defined functions and built-in functions.Enlist them.
4. List out the advantages of function.
5. What is the recursive function? List out their merits and demerits.
6. Write a program for finding greatest of ‘n’ numbers using function.
7. Write a program for finding Fibonacci series using recursion.
8. Write a program to increment the value of an argument using call by value
9. Write a program for swapping two values using call by reference method

Arrays and Pointers


MCQ(Type 1) Marks:- 1

1. A program that has no command line arguments will have argc


a) Zero
b) Negative
c) One
d) Two
2. The index of the last argument in command line arguments is
a) argc – 2
b) argc + 1
c) argc
d) argc – 1

3.What does argv and argc indicate in command-line arguments?


(Assuming: int main(int argc, char *argv[]) )
a) argument count, argument variable
b) argument count, argument vector
c) argument control, argument variable
d) argument control, argument vector

5. What type of array is generally generated in Command-line argument?


a) Single dimension array
b) 2-Dimensional Square Array
c) Jagged Array
d) 2-Dimensional Rectangular Array
6. Advantage of a multi-dimension array over pointer array.
a) Pre-defined size.
b) Input can be taken from user.
c) Faster Access.
d) All of the mentioned
7. Which of the following operation is possible using a pointer char?
(Assuming declaration char *a;)
a) Input via %s
b) Generation of multidimensional array
c) Changing address to point at another location
d) All of the mentioned
8. Which of the following are generated from char pointer?
a) char *string = “Hello.”;
b) char *string;
scanf(“%s”, string);
c) char string[] = “Hello.”;
d) char *string = “Hello.”; and char string[] = “Hello.”;
9. Which of the following declaration are illegal?
a) int a[][] = {{1, 2, 3}, {2, 3, 4, 5}};
b) int *a[] = {{1, 2, 3}, {2, 3, 4, 5}};
c) int a[4][4] = {{1, 2, 3}, {2, 3, 4, 5}};
d) none of the mentioned

Short Question (Type 2): Marks:-2


1. What is array?
2. Explain what is pointer?
3. how two – dimensional array is initialize?
4. What is dynamic memory allocation?
5. What is null string?
6. What is malloc()?
7. What is calloc()?
8. What is multidimensional array?
Subjective Question(Type3) Marks:-3
1. What are the rules used to declare a one dimensional array?
2. What are the rules used to declare a two dimensional array?
3. What are the rules used to declare a multi dimensional array?
4. What is character array how it differs from other data types?
5. Distinguish between character array and string.
6. What is an array indexing explain with an example?
7. When sorting the elements of an array is it necessary to use another array to store the
sorted elements explain?
Broad question (Type 4) Marks:-5
1. Write a C Program to sort an array in ascending order
2. Write a C Program to sort an array in descending order
3. Write a C language program to enter n elements in array and find second smallest number
from an array.
4. Define array. Explain different types of array in detail.
5. To write a program for finding the product of two matrices of any order.
6. Write a program for reading ‘N’ number of students with 5 subject marks.

Structures Union and Files

MCQ(Type 1) Marks:- 1

1. Which of the following are themselves a collection of different data types?


a) string
b) structures
c) char
d) all of the mentioned
2. User-defined data type can be derived by___________
a) struct
b) enum
c) typedef
d) all of the mentioned
3. Which operator connects the structure name to its member name?
a) –
b) <-
c) .
d) Both <- and .
4. Which of the following cannot be a structure member?
a) Another structure
b) Function
c) Array
d) None of the mentioned

5. Which of the following structure declaration will throw an error?


a) struct temp{}s;
main(){}
b) struct temp{};
struct temp s;
main(){}
c) struct temp s;
struct temp{};
main(){}
d) None of the mentioned

6. Which of the following is not possible under any scenario?


a) s1 = &s2;
b) s1 = s2;
c) (*s1).number = 10;
d) None of the mentioned
7. Which of the following operation is illegal in structures?
a) Typecasting of structure
b) Pointer to a variable of same structure
c) Dynamic allocation of memory for structure
d) All of the mentioned
8. Presence of code like “s.t.b = 10” indicate.
a) Syntax Error
b) structure
c) double data type
d) An ordinary variable name

9. FILE is of type ______


a) int type
b) char * type
c) struct type
d) None of the mentioned
10. Which type of files can’t be opened using fopen()?
a) .txt
b) .bin
c) .c
d) none of the mentioned

11. Which is true about getc.getc returns?


a) The next character from the stream is not referred by file pointer
b) EOF for end of file or error
c) Nothing
d) None of the mentioned

Short Question (Type 2): Marks:-2


1. What is structure?
2. What is union?
3. Explain fprintf() with example
4. Explain fscanf() with example
5. What is mean by member or field of structure?

Subjective Question(Type3) Marks:-3


1. Explain nested structure.
2. Explain array of structure.
3. Explain pointer to structure.
4. What is the difference between structure declaration and Structure initialization.
5. Explain the various modes used in file operation?

Broad question (Type 4) Marks:-5


1.Explain Getw() & Putw function.
2.Write a C language program to display the content of file using command line argument.
3.Write a C language program to copy the contents of one file to another file.
4. Explain any three of the following with example
i) fprintf() ii) fscanf() iii) getc() iv) feof()
5. Write a c program for displaying student information by initializing structures.
6. Define structure and union. Explain the way of declaring and accessing them.
7. How does the fopen() works?Explain it with example.

You might also like