C Programming - Unit Wise Questions

Unit 1: Introduction
3 Questions

4. Define the basic structure of C program. Explain the Compilation and Execution of a C program?

5 marks | Asked in Model Question

4. What is the basic structure of a C program? Explain each part.

5 marks | Asked in 2077

4. What is the basic structure of a C program? Explain each part.

5 marks | Asked in 2078

Unit 2: Elements of C
4 Questions

2. What is an identifier and keyword? Explain the rules for naming valid identifiers in C with example. Write a C program to find sum of digits of a 'n' digit number.

10 marks | Asked in 2077

2. What is an Identifier and Keyword? Explain the rules for naming valid Identifiers in C with example. Write a program to convert a given string to lowercase without using any library functions.    (3+2+5)

10 marks | Asked in 2078

3. What are different data types available in C along with their respective range? Write a program to check whether a given integer is palindrome or not.        (5+5)

10 marks | Asked in 2078

5. What are the uses of comments and escape sequences in a C program, explain with example?

5 marks | Asked in Model Question

Unit 3: Input/Output function
2 Questions

8. Explain any four input/output functions used in C language with suitable example.

5 marks | Asked in 2078

12. Write short notes on: [2+3]

        i) Formatted input/output

        ii) C Preprocessors/directives

5 marks | Asked in Model Question

Unit 4: Operators and Expression
2 Questions

1. What is an expression and operator? Discuss operator associativity in C. Write a program to find factorial of a given integer using recursion.        (2+3+5)

10 marks | Asked in 2078

6. What are relational operators and arithmetic operators? Write a C code to check if a given number is odd or even.

5 marks | Asked in Model Question

Unit 5: Arrays and Strings
6 Questions

1. Define array. Differentiate between 1D and 2D array. Write a program that stores 100 integers in an array and display them in ascending order.

10 marks | Asked in Model Question

6. What do you mean by multi-dimensional array? Write  program logic to add and display the sum of two m x n matrices.

5 marks | Asked in 2077

6. What do you mean by multi-dimensional array? Write a program to display the sum of two m x n matrices.    (1+4)

5 marks | Asked in 2078

7. Find errors (if any) in the following program and rewrite it.

        #define(studio.h)

        float main <>

        {

            int m[ ][ ] = ({1,2,3,4});

            for(i=4, i>=0; i--)

            for(j=0, j<4; j++);

            m[i][j] = a[i][j]+b[i][j];

            return 0.0;

        }

5 marks | Asked in 2077

8. How is string defined in C program? Write a program to check if a given string is a palindrome or not.

5 marks | Asked in Model Question

9. Write a C program to check whether a given string is palindrome or not.

5 marks | Asked in 2077

Unit 5: Control Structures
6 Questions

5. How break statement is different from continue statement. Explain with examples.

5 marks | Asked in 2077

5. How break statement is different from continue statement? Explain with suitable example.    (1+4)

5 marks | Asked in 2078

7. Define iterative statements. Write a program that using a loop to compute and prints the sum of squares of first 10 even natural numbers.

5 marks | Asked in Model Question

8. Write a program to generate the following pattern of Integers.

    

5 marks | Asked in 2077

9. Differentiate between switch case and else .. if ladder. Why is break statement used inside switch case? Explain briefly.

5 marks | Asked in Model Question

9. Write a program to generate the following pattern of integers.

        

5 marks | Asked in 2078

Unit 6: Functions
2 Questions

1. Explain the role of function in programming. How function is declared, defined and called in C? Write a program to find factorial of 'n' using recursive function.

10 marks | Asked in 2077

3. Discuss the advantages of using functions in programming. Differentiate between recursive function and normal function. Write a program using call by reference to swap the values of two variables.

10 marks | Asked in Model Question

Unit 7: The C Preprocessor
0 Questions
Unit 8: Pointers
5 Questions

10. Describe the concept of pointer and its arithmetic with suitable examples.

5 marks | Asked in Model Question

10. What is pointer? Illustrate the use of a double pointer with suitable example.

5 marks | Asked in 2077

10. Write a program to find smallest element of any array using a pointer.

5 marks | Asked in 2078

12. Write short notes on:

        a. Macros

        b. Null Pointer

5 marks | Asked in 2077

12. Write Short Notes on        (2.5+2.5)

    a. Escape Sequence

    b. Null Pointer

5 marks | Asked in 2078

Unit 9: Structure and Unions
3 Questions

2. Define structure. Write syntax for defining and initializing structure? Write a program that stores details of N employees (E_id, E_Name, Salary), and display the details of those employees whose salary is less than 10000.

10 marks | Asked in Model Question

3. How structure is different from union? Write a program to store and display basic information (roll, name, address, email and phone) of students of using a structure.

10 marks | Asked in 2077

11. Write a program to store and display basic information (Roll, name, address, email, and phone) of students using a structure.

5 marks | Asked in 2078

Unit 10: File Handling
3 Questions

7. Write a program to create a file "duplicate" that contains the exact copy of file "original".

5 marks | Asked in 2078

11. Explain the syntax of fwrite() function. Write a program to create a file named "student.txt" and stores record of any five students given by user.

5 marks | Asked in Model Question

11. Why file is used in programming? Explain different file opening modes.

5 marks | Asked in 2077