C Programming - Unit Wise Questions
4. Define the basic structure of C program. Explain the Compilation and Execution of a C program?
4. What is the basic structure of a C program? Explain each part.
4. What is the basic structure of a C program? Explain each part.
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.
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)
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)
5. What are the uses of comments and escape sequences in a C program, explain with example?
8. Explain any four input/output functions used in C language with suitable example.
12. Write short notes on: [2+3]
i) Formatted input/output
ii) C Preprocessors/directives
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)
6. What are relational operators and arithmetic operators? Write a C code to check if a given number is odd or even.
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.
6. What do you mean by multi-dimensional array? Write program logic to add and display the sum of two m x n matrices.
6. What do you mean by multi-dimensional array? Write a program to display the sum of two m x n matrices. (1+4)
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;
}
8. How is string defined in C program? Write a program to check if a given string is a palindrome or not.
9. Write a C program to check whether a given string is palindrome or not.
5. How break statement is different from continue statement. Explain with examples.
5. How break statement is different from continue statement? Explain with suitable example. (1+4)
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.
8. Write a program to generate the following pattern of Integers.
9. Differentiate between switch case and else .. if ladder. Why is break statement used inside switch case? Explain briefly.
9. Write a program to generate the following pattern of integers.
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.
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. Describe the concept of pointer and its arithmetic with suitable examples.
10. What is pointer? Illustrate the use of a double pointer with suitable example.
10. Write a program to find smallest element of any array using a pointer.
12. Write short notes on:
a. Macros
b. Null Pointer
12. Write Short Notes on (2.5+2.5)
a. Escape Sequence
b. Null Pointer
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.
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.
11. Write a program to store and display basic information (Roll, name, address, email, and phone) of students using a structure.
7. Write a program to create a file "duplicate" that contains the exact copy of file "original".
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.
11. Why file is used in programming? Explain different file opening modes.