[go: up one dir, main page]

0% found this document useful (0 votes)
77 views6 pages

PPS QB

adstkuyk

Uploaded by

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

PPS QB

adstkuyk

Uploaded by

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

UNIT –I : OVERVIEW OF COMPUTERS AND C-PROGRAMMING

Conditional Control structures


Short Answer (2 mark) Questions
1. What is Computer. Describe the various types of computers
2. Draw the block diagram of computer?
3. What is an identifier (variable)? What are the rules to construct identifier
4. Write difference between algorithm and flowchart.
5. Differentiate between Compiler and Interpreter.
6. With a neat diagram explain the basic structure of a computer
7. Explain the importance of C language.
8. What is format specifier?
9. Define keyword, constant and variable.
10. Write a short note on type casting.
11. Explain sizeof() with example?
12. Why do we use header files?
13. Define relational operator(all types of operators comes the same way)?
14. What is the purpose of adding comments in a program?
15. Differentiate between computer software and hardware?
16. Draw the flowchart and write a C program to compute simple interest
17. What is Token? What are the different types of token available in C language
18. Explain with example, the various constants available in „C‟ language
19. What is type conversion? Explain two types of conversion with examples
20. Classify the different types of decision making statements.
21. How switch case works without break statement.
22. Write the syntax for nested if and else-if ladder?
23. Write a program to check whether the person is eligible to vote.

Long Answer (10 mark) Questions


1. Describe in detail about components of computer with block diagram [10]
2. Write detailed notes on C data types. [10]
3. Write an algorithm, flowchart and C program to find the sum of numbers from 1 to ‗n‘
4. Discuss about the operators in C language with example. [4+3+3]
5. Perform the following operations [2+2+2+2+2]
a. 23>>3 b. 27<<2 c. 15&9 d. 15^9 e. 15 | 9
6. (a) Write the structure of C program and explain. [5+5]
(b) Write a program to perform swapping of two numbers without using temporary variable.
7. (a) Define algorithm. Write algorithm for finding factorial of a number. [4+6]
b) What is flowchart? Explain different symbols used for flowchart.
8. (a) What is constant? Explain different constants in C. [6+4]
(b) What is variable? Give the rules for variable declaration.
9. (a) Write an algorithm and flowchart to generate Fibonacci series of numbers up to 'n'.
(b) Draw the flowchart to find the greatest of three numbers. [5+5]
10. (a) Write an algorithm and flowchart to find whether the given number is prime or not.
(b) Explain about type conversion in C. [5+5]

11. Explain various branching statements in C with examples. [10]


12. (a) Write and explain about switch statement. [4+6]
(b) Write a Program to perform arithmetic operations using switch.

UNIT –II : DECISION & LOOP CONTROL STATEMENTS


Short Answer (2 mark) Questions

1. Write and explain syntax of ―for‖ loop.


2. Distinguish between while and do-while statements.
3. Write a program to print the multiplication table from 1 to n?
4. Differentiate between break and continue.
5. Define goto with an example.
6. Define exit and return statements.
7. What is an array? Write the types of an array.
8. How to declare and initialize 1-D, 2-D array with an example.
9. What is multi-dimensional array?
10. Write a program to read and display the elements using 1-D array.
11. Write a program to print the array elements in reverse order.
12. What is array of strings?
13. Display string ―pepper‖ in reverse order
14. Discriminate puts() and gets()
15. Discriminate putchar() and getchar()
16. How can you compare two strings?

Long Answer (10 mark) Questions


1. Explain control structures in detail. [10]
2. List and explain loop control (or) iteration statements in C. [10]
3. (a) Write and explain syntax of for loop. [3+7]
(b) Write a program to generate prime numbers between 1 and n.
4. (a) Write a program to check whether the given number is palindrome or not. [5+5]
(b)Write a program to check whether the given number is Even or Odd using goto statement.
5. List and explain unconditional statements in C with examples. [10]
6. (a) Write a program to find sum of the individual digits of a given number. [5+5]
(b) Write a program to find the sum of even and odd numbers from 1 to n.
7. (a) Write a program to find the factorial of a given number. [5+5]
(b) Write a program to generate n Fibonacci numbers.
8. (a) What is a nested loop? Write a program to display multiplications tables from 1 to
n.
(b) Write a program to display the following pattern. [5+5]
*****
****
***
**
*
9. (a) Explain else-if ladder with the help of flowchart and program. [5+5]
(b) How does nested if-else works explain with an example?
9. (a) Define an array. How to initialize one-dimensional array? Explain with suitable examples.
(b) Write a C program to sort the given array elements in Ascending order. [5+5]
10. (a) How to declare and initialize a Two-dimensional array? Discuss with examples. [5+5]
(b) Write a C program to print the sum of diagonal elements of 2-D matrix.
11. Write a C program to multiply two matrices of different order. [10]
12. (a) Write a C program to read and display a 3 by 3 matrix. [5+5]
(b) Write a C program to add 2 matrices of size n by n.
13. (a) Illustrate multidimensional arrays with example program. [5+5]
(b) Write a C program to find the largest element given in an array of elements.
14. (a) Write a C program to count the number of vowels, consonants, digits, spaces and special
characters in a given string. [5+5]
(b) Write a C program to read the elements in an array and print the same in reverse order.
15. (a) Write a C program to implement strcmp() , strcat() , strcpy() and strlen(). [5+5]
(b) Write a program to find the average marks obtained by a class of 50 students in a test.
16. (a) Explain declaration and initialization of array of strings. [4+6]
(b) Write a C program to find whether a given string is palindrome or not.
17. (a) Discus about arithmetic operations on characters. [5+5]
(b) Write a C program to read a set of strings and sort them in alphabetical order.
18. Explain the following string handling functions with example: [10]
a. strcpy() b. strcmp() c. strcat() d.strlen() e. strncat()
UNIT –III : Functions,Structures & Unions
Short Answer (2 mark) Questions
1. What is a function? Write the types of functions.
2. What is meant by call-by value and call-by reference?
3. What is recursion?
4. Write and explain the syntax of function?
5. What is #include, #define directives.
6. Define Structure? How to Initialize a Structure?
7. How to represent self-referential structures?
8. Define Union? How to represent a union?
9. Write some of the differences between Structure and Union?
10. What are the Different ways of representing Structures and Functions?

Essay Answer (10 mark) Questions


1. (a) What are the advantages of functions? [3+7]
(b) Write a C program using function to exchange two numbers using pointers.
2. (a) Discuss about the different categories of functions. [5+5]
(b) Write a C program to illustrate call-by-value parameter passing technique.
3. (a) Write short notes on nested functions. [4+6]
(b) Write a C program to explain call-by-reference parameter passing technique.
4. (a) What is recursion? What are the advantages and Disadvantages of recursion? [4+6]
(b) Write a C program to find the factorial of a given number using recursion.
5. Distinguish between the following: [4+3+3]
a. Actual and formal arguments
b. Global and local variables
c. Automatic and static variables
6. (a) Define Structure and write the general syntax for declaring and accessing members.
(b) How to copy and compare structure variables? Illustrate with example. [5+5]
7. Write a C program that defines a structure employee containing the details such as empno,
empname, department name and salary. The structure has to store 20 employees in an
organization. Use the appropriate method to define the above details and define a function that will
display the contents?[10]
8. (a) Explain the following: [6+4]
a. Nested structures ii. Array of structures
(b) Write a C program to read and display student details using structure.
9. (a) Define union. Give the general template for union. [4+6]
(b) List out the differences between unions, structures and arrays
10. (a) How data elements are stored under unions, explain with example? [5+5]
(b) Write a C program to illustrate the concept of structure within structure.
11. Explain in detail about preprocessor directives. [10]
12. write a short notes with examples on a.Bitfields b. typedef c. enumerations [10]

UNIT –IV : POINTERS AND DYNAMIC MEMORY ALLOCATION


Short Answer (2 mark) Questions

1. Define pointer. How can you declare it?


2. What is pointer to pointer?
3. What is pointer arithmetic?
4. Define pointer array.
5. How can you read a string through keyboard?
6. Define static memory allocation.
7. List the built in functions supporting dynamic memory allocation.

Essay Answer (10 mark) Questions


1. (a) Define pointer. How to declare and initialize it. [5+5]
(b) Write a C program to illustrate the use of indirection operator to access the value
pointed by a pointer.

2. (a) What are the features of pointers? Write a C program to print address of a variable
(b) Explain the declaration of pointers and pointer to pointer with examples. [6+4]
3. (a) With proper examples explain different arithmetic operations on pointers. [6+4]
(b) Write a C program to show that pointer of any data type occupies same space.
4. (a) Explain the concept of functions returning pointers with example. [5+5]
(b) Write a C program to read and print an array of elements using pointers.
5. (a) Explain the concept of array of pointers with examples. [4+6]
(b) Write a C program to read and display multiple strings using pointers.
6. Explain in detail
a. malloc
b. calloc
c. Realloc
d. free
UNIT –V : FILE HANDLING, SEARCHING AND SORTING
Short Answer (2 mark) Questions

1. What are the Different file operations?


2. Write about Sequential file handling functions?
3. Write about Random file handling functions?
4. Write about different file modes?
5. Write about different error handling functions on files?
6. Define linear search and binary search.
LONG ANSWERS
1. (a) Write the syntax for opening a file with various modes and closing a file. [4+6]
(b) Explain the following file handling functions:
a. fseek() b. ftell() c. rewind() d. feof()
2. (a) Write a C program to display the contents of the file in reverse order. [5+5]
(b) Write a C program to copy the contents from one file to another file.
3. Write a C program to count no.of characters, spaces, lines, words of a file. [10]
4. (a) Discuss command line arguments in detail with examples. [5+5]
(b) Write a short notes on
i. fgets() ii. fputs()
5. Write a program in C that reads the name of a file and displays the contents of the file on the user screen.
6. Program to implement linear search, binary search, bubble sort.

You might also like