0% found this document useful (0 votes)
26 views4 pages

C Programming Exam Questions & Answers

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views4 pages

C Programming Exam Questions & Answers

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PC important questions

Unit 1
Part A
1. What are the types of I/O statements available in C?
2. What is the difference between if and while statement?
3. List the different data types available in C.
4. What is the difference between break and continue statement?
5. Enlist the rules for naming an identifier.
6. What are keywords?
7. What do you meant by conditional/ternary operator?
8. What is the basic structure of C program?

Part B
1. Data types and Constants
2. Pre processor directives
3. Looping and branching
4. Switch case
5. Operators
6. Write the C program to read three numbers and find the largest one by using the “else-
if” ladder.
7. Write a C program for the following :
i)To check whether a given year is leap year or not.
ii)To check whether a given number is palindrome or not. To check whether a given
number is Armstrong or not
iv) to find factorial and Fibonacci series of given number
8. i)Write a C program to find the sum of the digits of a number.
(123 => 1+2+3=6)
9. Write a C program to find the sum of all odd / even numbers between 1 and 100
10. Write a C program to check whether a number is prime or not.
11. C program to addition, subtraction and multiplication using switch case.

Unit 2
Part A
1. Declare a float array of size 5 and assign 5 values to it.
2. Write the output of the following Code:
main()
{
char x; x = ‘a’;
printf(“%d \n”,x);
}
3. Give an array int a[10]={101, 102, 102, 103, 104, 105, 106, 107, 108, 109, 110}.show
the memory representation and calculate the length.
4. Brief any two library functions used for string handling.
5. Define sting arrays.
6. .How to declare string in C language.
7. What is the use of ‘\0’ and ‘%s’.

Part B
1. String and its operations with example
2. 1D array with declaration, initialization and accessing with example
3. Program for searching Sorting using array.
4. C program to find min and max in array.
5. Write a C program for Matrix multiplication and addition

Unit 3
Part A
1. What is the relation between the operators “&” and “*” in C pointers?
2. Write the syntax for function declaration.
3. What are the steps in writing a function in a program?
4. Define extern storage class.
5. What is a recursion?
6. Why do we need double pointer?
7. What do you understand by scope of a variable?
8. Differentiate built-in functions and user defined functions.
9. Compare actual and formal parameter.
10. How to use pointer.
Part B
1. Function prototypre and function call.
2. Categories of function call.
3. Swapping of 2 numbers using call by value and call by reference.
4. Recursion and Binary search using recursion program
5. Array of pointers using example
6. Write a C program to calculate a given number's power, square, log, exp, and round
using built-in functions.
7. Write C program to compute factorial using recursion.

Unit 4
Part A
1. What are the key differences between structure and union?
2. Compare arrays and structures in C.
3. How to allocate memory dynamically in C language?
4. In language C can we allocate memory dynamically?How?
5. Write the syntax for a pointer to structure.
6. Define enumerated data type.
7. Define structure and write its syntax.
8. Define union and write its syntax.
Part B
Structure
Union
Enumerated data type
Lab exercise 6 a and b
Union program for library

Unit 5
Part A
1. What will be the impact if “fclose()” function is avoided in a file handling C
program?
2. What is meant by command line argument? Give an example?
3. Why files are needed?
4. Distinguish between text mode and binary mode operation of a file.
5. What is the use of fseek() and rewind() functions in a file?
6. What is the use of EOF in a file
7. Distinguish between gets() and fgets().
8. Mention the types of files used in C programming.
9. Why do we need to store data in files?
10. What are the attributes of file.
Part B
1. File operations
2. Sequential access and program for Finding average of numbers using sequential
access
3. Random access and Program for payroll system and transaction using random access.
4. Describe the command line argument in C. Write a C program to find an average of n
numbers using the command line argument.

You might also like