You are on page 1of 21

C QUESTION PAPER 1. C is a _____________. a. Middle Level Language b. High Level Language c. Low Level Language d.

None of the above 2. The maximum width of a C variable name can be a. 6 characters b. 8 characters c. 10 characters d. depends on the compiler 3. If a is an integer variable a=5/2 will return a value a. 2.5 b. 3 c. 2 d. 0 4. _____________ is a two way decision statement. a. for b. while c. if d. switch 5. C allows arrays of a. single dimensions b. two-dimensions c. three or more dimensions d. none of the above 6. The _____________ declaration does not allocate storage space for variables. a. extern b. auto c. static d. register 7. A _____________ field is a set of adjacent bits whose size can be from 1 to 16 bits in length. a. size of() b. bit c. struct d. pointer 8. _____________ reduce the length and complexity of a program. a. strut b. union c. pointer d. array 9. _____________ gives the current position in the file. a. fseek() b. ftell() c. fputc() d. fgetc() 10. Which among the following is error handling during I/O operations?

C QUESTION PAPER a. Trying to use a file that has been opened b. Attempting to write in a file c. Opening a file with an invalid filename d. None of the above 11. a. What are the basic types of constants in ()? Explain with examples. Or b. Explain any four types of operators in C with example. 12. a. Distinguish between while and do-while statements in C and give the general form of the statements.Or b. Write a C program to find sum and standard deviation of the given set of n number using for statements. 13. a. Write a note on scope of the variable in functions. Or b. Write a program to find factorial of a given number entered through key board using function. 14. a. Write a short note on union. Or b. Discuss the method for passing structures to a function with example. 15. a. Explain the general form of fopen functions in detail. Or b. Describe the command line arguments concept with example. 16. a. A five digit number is given as input through the keyboard. Write a program to calculate the sum of first and last digits of the given number. Or b. A character is entered through the keyboard, write a program to determine whether the character entered is a capital letter, small case letter, a digit or special character. 17. a. Explain the following with illustration: i. Switch statement (3 marks) ii. For statement (3marks) iii. Continue, break statement (2 marks)

C QUESTION PAPER Or b. Write a C program to sort the given names in alphabetical order using nested for statements. 18. a. What is recursion? Explain it with example program to find reverse the number of a given number. Or b. Explain the following: i. Call by value ii. Call by reference 19. a. What is a pointer? How will you pass pointrs to a function? Explain with example. Or b. Write a function using pointers to add two matrices and return the resultant matrix to the calling function.

20. a. Explain the following: i. getc ii. putc iii. getw iv. putw v. fprintf() vi. fscanf() vii. fseek viii. rewind Or b. There are 100 records present in a file. Write a program to read these records, arrange them in ascending order and write them into a target file. 1. Operators that act upon a single operand to produce a new value is known as _____________ operator. a. unary b. size of c. unary minus

C QUESTION PAPER d. unary plus 1.0 Mark(s) 2. The conversion character 'S' is displayed as a _______________. a. String constant b. Signed integer c. Single character d. None of the above 1.0 Mark(s) 3. ______________ operator is poplulary known as the conditional operator. a. || b. | c. && d. ?: 1.0 Mark(s) 4. The __________________ is an entry controlled loop statement. a. for b. switch c. while d. do ... While 1.0 Mark(s) 5. In C program, execution starts from _____________ function. a. library b. header c. userdefined d. main() 1.0 Mark(s) 6. The ___________________ statement is necessary only when the function is returning some data. a. continue

C QUESTION PAPER b. return c. call d. break 1.0 Mark(s) 7. ________________ which is also known as dot operator. a. Member operator b. Conditional operator c. Bitwise d. None of the above 1.0 Mark(s) 8. _____________ reduce the length and complexity of a program. a. Union b. Pointer c. Struct d. Function 1.0 Mark(s) 9. ftell() gives _______________. a. current position in the file b. sets the position to a desired point in the file c. peep sound d. end of the file 1.0 Mark(s) 10. The _________________ function reserves blocks of memory of specified size and return a pointer. a. size of() b. malloc() c. pointer d. calloc() 1.0 Mark(s)

C QUESTION PAPER 11. a. What is constants? Explain its types. Or b. Distinguish between getchar() and putchar() functions. 12. a. Explain the usage of switch ... case statement. Or b. Write a program to find the biggest no. in the given set of numbers using conditional operators. 13. a. Define function. How to handle the non-integer functions? Or b. Write a C program to create a function that will generate and print first n Fibonacci numbers. 14. a. What is a structure? Explain in detail. Or b. How to access a variable through its pointer? Explain. 15. a. Describe the two different methods for creating a stream oriented data file. Or b. Describe the command line parameters concept with example. 16. a. Write a note on operators in C. Or b. Develop a C program for temperature conversion problem by using the formula [c=(F-32)/1.8]. 17. a. What is Decision making? Explain about If statements and its types. Or b. Write a short note on 'String-Handling Functions'. 18. a. Write a function to sort the given set of 'N' numbers in ascending order. Or b. Write a recursive function to calculate the factorial of a given number and return to the calling function. 19. a. What is a pointer? Explain about operations on pointers with examples. Or b. Write a C program to demonstrate array of structures implementation.

C QUESTION PAPER 20. a. Write a note on basic file operations. Or b. Define the following: (i) Macro (ii) Random Access File 1. Who developed C language? a. Dennis Ritchie b. BPCL c. Bjarue Ritchie d. Dennis Pascal 1.0 Mark(s) 2. Every statement in C should end with a _____________. a. Semicolon b. Colon c. Comma d. Dot 1.0 Mark(s) 3. The conditional operator takes _____________ operands. a. One b. Three c. Two d. Four 1.0 Mark(s) 4. Any group of characters defined between _____________ marks is a constant string. a. Quotation comma b. Double quotation c. Question d. Single quotation

C QUESTION PAPER 1.0 Mark(s) 5. C functions can be clarified into two categories namely _____________ functions and user-defined functions. a. Any-user defined b. Non-user defined c. Litrary d. More-user defined 1.0 Mark(s) 6. _____________ is a special case, where a function calls itself. a. Return b. Reverse c. Recursion d. Repeat 1.0 Mark(s) 7. A method of packing data of diferent types is _____________. a. Array b. Package c. Pointer d. Structure 1.0 Mark(s) 8. _____________ operator is used to access a variable through its pointer. a. Decrement b. Direction c. Increment d. Indirection 1.0 Mark(s) 9. _____________ function reads an integer from a file. a. getw()

C QUESTION PAPER b. getc() c. putc() d. getchar() 1.0 Mark(s) 10. The _____________ function can be used to test for an end of file condition. a. feof() b. fprintf() c. fscanwf() d. fgetc() 1.0 Mark(s) 11. a. Write a program to solve a quadratic equation. Or b. Write a program that reads a character from keyboard and then prints it in reverse case. 5.0 Mark(s) 12. a. Explain the simple if statement. Or b. Write a program to copy one string into another. 5.0 Mark(s) 13. a. Write a program that uses a function to sort an array of integers. Or b. Discuss about functions with arrays. 5.0 Mark(s) 14. a. Brief a note on unions. Or b. How can you declare and initialize pointers? 5.0 Mark(s) 15. a. Explain fseek. Or

C QUESTION PAPER b. Write about opening a file. 5.0 Mark(s) 16. a. Brief a note on constants. Or b. Describe the formatted input. 8.0 Mark(s) 17. a. Explain the FOR statement. Or

b. What is an array? How will you classify? 8.0 Mark(s) 18. a. Name the four storage classes. Explain. Or b. How can you classify the functions in C? 8.0 Mark(s) 19. a. Write a note on pointers and structures. Or b. Distinguish between structure and union. 8.0 Mark(s) 20. a. Explain command line arguments. Or b. Give a detailed note on fprintf function. 1. Which among the following is not a key word? a. cost b. else c. switch d. int 1.0 Mark(s)

C QUESTION PAPER 2. The symbol '\n' stands for _____________. a. newline b. form feed c. null d. carriage 1.0 Mark(s) 3. _____________ is a two-way decision statement. a. for b. if c. switch d. while 1.0 Mark(s) 4. _____________ is a group of related data items that share a common name. a. An index b. An array c. A variable d. An element 1.0 Mark(s) 5. Functions return _____________ value by default. a. character b. float c. integer d. double 1.0 Mark(s) 6. The program execution always begins with the _____________ function. a. library b. system c. main

C QUESTION PAPER d. printf 1.0 Mark(s) 7. All the members of a _____________ use the same memory location. a. array of structure b. structure c. function d. union 1.0 Mark(s) 8. A _____________ is a variable that contains an address which is a location of another variable in memory. a. union b. structure c. character d. pointer 1.0 Mark(s) 9. The modes used in opening a file are _____________. a. r b. bwk c. awk d. any one of the above 1.0 Mark(s) 10. Main can take two arguments called _____________ and _____________. a. argc, argv b. char, float c. int, float d. double, int 1.0 Mark(s) 11. a. Write a program to output any multiplication table.

C QUESTION PAPER Or b. Write a program to calculate the average of a set of N numbers. 5.0 Mark(s) 12. a. Write a program to find the largest of three numbers using nested if. Or b. Illustrate comparision of two strings with a C program. 5.0 Mark(s) 13. a. Explain the general form of C functions. Or b. Write a function power that computes x raised to the power y for integers x and y and returns double type value. 14. a. How can you define a structure? Or b. Implement string handling by pointers in a C program. 5.0 Mark(s) 15. a. Discuss about opening file. Or b. Explain the getw and putw functions. 5.0 Mark(s) 16. a. Brief a note on data types in C. Or b. How can you classify operators? 8.0 Mark(s) 17. a. Explain the switch statement. Or b. Describe any two string-handling functions. 8.0 Mark(s) 18. a. Discuss the different categories of functions.

C QUESTION PAPER Or b. What is recursion? Explain with example. 8.0 Mark(s) 19. a. Describe array of structures. Or b. Illustrate with a program, the use of pointers in arithmetic operations. 8.0 Mark(s) 20. a. Explain the preprocessor. Or b. Discuss about any two functions used in random access to files.

1. An ____________ is a name used to identify a variable, function, symbolic constant and so on. a. operator b. separator c. keywords d. identifiers 0.5 Mark(s) 2. The ______________ operator is used to link related expression together to make the program more compact. a. relational operator b. bit-wise operator c. comma operator d. increment operator 0.5 Mark(s) 3. Which is invalid variable name? a. minimum b. row c. 3 rows

C QUESTION PAPER d. name 0.5 Mark(s) 4. What is the use of "\n"? a. Null character b. Move to new line c. Horizontal tab d. Vertical tab 0.5 Mark(s) 5. ___________ statement can be used to avoid multiple nested if conditions. a. if statement b. for statement c. goto statement d. switch statement 0.5 Mark(s) 6. The ____________ statement is used to transfer the control to the end of switch statement. a. break b. continue c. return d. goto statement 0.5 Mark(s) 7. In C, an array of characters is called ________________. a. two-dimensional array b. structures c. string d. pointers 0.5 Mark(s) 8. Which is null character? a. '\b'

C QUESTION PAPER b. '\0' c. '\n' d. %f 0.5 Mark(s) 9. A function calling itself again and again to compute a value is referred to _____________. a. User defined function b. Loop function c. Iteration d. Recursion 0.5 Mark(s) 10. Local variables are placed at the ____________ of any function. a. beginning b. outside c. inside d. center 0.5 Mark(s) 11. ______________ variable can be referred in a function. They need not be passed to the function as arguments. a. static b. auto c. extern d. register 0.5 Mark(s) 12. A function, which does not return a value directly to the calling program, is referred as ___________ function. a. multi-function program b. void c. user defined function

C QUESTION PAPER d. integer function 0.5 Mark(s) 13. __________ is structure that is defined in the I/O library. a. POINTERS b. FILE c. Struct d. HEADER files 0.5 Mark(s) 14. When an array is passed as an argument to a function, a ________________ is actually passed. a. int b. float c. char d. pointer 0.5 Mark(s) 15. The indirection operator is ____________. a. & b. %d c. * d. ^ 0.5 Mark(s) 16. The statement *ptr++ -> behave in a. Increments whatever p points to b. Fetch whatever p points to c. Increments ptr after accessing whatever it points to d. Increments p after accessing whatever it points to 0.5 Mark(s) 17. a+ is same as _____________ except both for reading and writing. a. w

C QUESTION PAPER b. w+ c. r d. a 0.5 Mark(s) 18. The ______________ function will close and disconnect the file from the program. a. close () b. feof () c. ferror d. fclose 0.5 Mark(s) 19. The preprocessor directives begin with ____________ followed by the command. a. # b. % c. $ d. & 0.5 Mark(s) 20. _____________ will return an end-of-file marker EOF. a. putc b. putchar c. getchar d. getc 0.5 Mark(s) 21. a. Describe the four basic data types.

Or

b. Write note on # define. 5.0 Mark(s)

C QUESTION PAPER 22. a. Explain IF statement.

Or

b. Write a 'C' program to find greates of given three numbers. 5.0 Mark(s) 23. a. Use recursive calls to evaluate factorial of a given number 'N'.

Or

b. Explain the form of C functions. 5.0 Mark(s) 24. a. What is a pointer? How is a pointer initialized?

Or

b. Write a function using pointers to exchange the values stored in two locations in the memory. 5.0 Mark(s) 25. a. Explain getw and putw functions.

Or

b. Write note on fseek function. 5.0 Mark(s) 26. a. What are the different types of operators availbale in C?

Or

C QUESTION PAPER b. Explain the keywords: getchar, putchar (), gets () and puts() 8.0 Mark(s) 27. a. Explain the significance of switch-case construct. Explain the use of break statement in this construct.

Or

b. Write note on arrays in 'C'. 8.0 Mark(s) 28. a. Explain 'call by reference' and 'call by value' with example.

Or

b. Discuss the scope and life time of variables in 'C'. 8.0 Mark(s) 29. a. Discuss structures in 'C'.

Or

b. Write a program using pointers to compute the sum of all elements stored in an array. 8.0 Mark(s) 30. a. Explain the role of C preprocessor.

Or

b. Discuss Command line arguments. 8.0 Mark(s)

C QUESTION PAPER