This document contains the questions for a test on C programming for the 1st year B. Tech students of Kumaon Engineering College. It has 4 sections with a total of 60 marks. Section 1 has 4 multiple choice questions worth 5 marks each on data types in C, storage classes, swapping variables without a third variable, and arguments to the main function. Section 2 has similar 4 multiple choice questions worth 5 marks each on recursion, functions, arrays, matrices, structures, and unions. Section 3 has 2 questions worth 5 marks each on Armstrong numbers and a calculator program. Section 4 has 2 questions worth 5 marks each on strings, structure pointers, and file streams in C. Students are required to attempt all questions in the
This document contains the questions for a test on C programming for the 1st year B. Tech students of Kumaon Engineering College. It has 4 sections with a total of 60 marks. Section 1 has 4 multiple choice questions worth 5 marks each on data types in C, storage classes, swapping variables without a third variable, and arguments to the main function. Section 2 has similar 4 multiple choice questions worth 5 marks each on recursion, functions, arrays, matrices, structures, and unions. Section 3 has 2 questions worth 5 marks each on Armstrong numbers and a calculator program. Section 4 has 2 questions worth 5 marks each on strings, structure pointers, and file streams in C. Students are required to attempt all questions in the
This document contains the questions for a test on C programming for the 1st year B. Tech students of Kumaon Engineering College. It has 4 sections with a total of 60 marks. Section 1 has 4 multiple choice questions worth 5 marks each on data types in C, storage classes, swapping variables without a third variable, and arguments to the main function. Section 2 has similar 4 multiple choice questions worth 5 marks each on recursion, functions, arrays, matrices, structures, and unions. Section 3 has 2 questions worth 5 marks each on Armstrong numbers and a calculator program. Section 4 has 2 questions worth 5 marks each on strings, structure pointers, and file streams in C. Students are required to attempt all questions in the
Note: Attempt ALL questions. All questions carry equal marks.
1. Attempt any FOUR parts of following:
(54=20)
(a) Explain various Data types in C with suitable examples ?
(b) What are the different Storage Class? Write a function in C to show the uses of Static Storage Class? (c) Write a program in C to swap the contents of two variables without using any other variable? (d) What are arguments to main ()? Describe it with an appropriate example? (e) To check whether a given number is Prime or not? 2. Attempt any FOUR parts of following: (54=20) (a) What is Recursion in C programming? Write a program to print Fibonacci series of n numbers using recursion? (b) How functions are used to support Modular Programming in C? Explain the following terms with a sample program (i) Function Declaration (ii) Function Calling-call by value, call by reference. (c) What is an Array? How Two Dimensional Array are represented in C? (d) Write a C program to add two given Matrices of dimensions m*n (where m & n >10) to produce a third matrix? (e) What are Structure and Union data type in C? How they are used? How their elements are accessed? Explain with an example? 3. Attempt any two parts of following: (52=10) (a) Write a C program to find out Armstrong numbers between 1 to n where n is a real number? (b) To implement a Calculator which do all arithmetic operation using SWITCH-CASE? (c) Write a C program which read the name, marks & roll no of student in a structure and arrange them in descending order of marks obtained? 4. Attempt any two parts of following: (52=10) (a) How a String is represented in C? Write a program in C to find if a String is palindrome (same if read from beginning or end) ? (b) What are Structure Pointers? Write a C program passing Structure to a function? (c) What are Standard Streams in C? How a Stream are differ from a file ? Describe the following file system basics using suitable examples (i) fprintf() (ii) fscanf() (iii) fread() (iv) fwrite() .