Docsity

module wise question bank , Exams of Computer Science

Toggle sidebar
bg1
PROGRAMMING IN C AND DATASTRUCTURES-15PCD13/23
MODULE- 1 QUESTION BANK
C103.1 / C203.1. Achieve Knowledge of design, development of C problem solving skills &
Understand the basic principles of Programming in C language.
1. What is algorithm, flow-chart, Pseudocode. Give an example for each.
2. Explain the structure of C program.
3. What is token? Explain the different types of tokens available in C language.
4. What are data types? Mention the different data types supported by C language, giving
an example to each.
5. What is variable? Give the rules for writing a variable. Also, Explain declaration
statement with example.
6. Explain Unformatted and Formatted Input and Output functions (Data I/O functions).
7. What is an Operator? List and explain various types of operators with example for each.
8. Explain Type Casting and its types.
9. Design and develop Algorithm, Flow-chart, Pseudocode, Program for the following.
Sum of 2 numbers
Area and perimeter of a circle
Area and perimeter [2*(l+b)] of a rectangle
Area of square, triangle
Calculation of simple interest : ptr/100, compound interest : p(1+r)t-p
Volume and area of sphere
Volume and surface area of cube
Swap 2 numbers
Swap 2 numbers without using temporary variable
Convert temperature in degree to Fahrenheit
Input and output a character using unformatted I/O functions
Input and output a character using formatted I/O functions
10. W rite C expressions for given mathematical expression. Evaluate the following.
X=3,k=2. Find x,y,k.
Y= x++ - --k
Y=--k * ++x
Y=x++ - k—
Y=--x + k—
J=4,k=2, find ++k % --j
i=4, j=3, find i++ - j—
Source diginotes.in
pf3
pf4
pf5

Partial preview of the text

Download module wise question bank and more Exams Computer Science in PDF only on Docsity!

PROGRAMMING IN C AND DATASTRUCTURES-15PCD13/

MODULE- 1 QUESTION BANK

C103.1 / C203.1. Achieve Knowledge of design, development of C problem solving skills & Understand the basic principles of Programming in C language.

  1. What is algorithm, flow-chart, Pseudocode. Give an example for each.
  2. Explain the structure of C program.
  3. What is token? Explain the different types of tokens available in C language.
  4. What are data types? Mention the different data types supported by C language, giving an example to each.
  5. What is variable? Give the rules for writing a variable. Also, Explain declaration statement with example.
  6. Explain Unformatted and Formatted Input and Output functions (Data I/O functions).
  7. What is an Operator? List and explain various types of operators with example for each.
  8. Explain Type Casting and its types.
  9. Design and develop Algorithm, Flow-chart, Pseudocode, Program for the following.  Sum of 2 numbers  Area and perimeter of a circle  Area and perimeter [2*(l+b)] of a rectangle  Area of square, triangle

 Calculation of simple interest : ptr/100, compound interest : p(1+r)t-p

 Volume and area of sphere  Volume and surface area of cube  Swap 2 numbers  Swap 2 numbers without using temporary variable  Convert temperature in degree to Fahrenheit  Input and output a character using unformatted I/O functions  Input and output a character using formatted I/O functions

  1. W rite C expressions for given mathematical expression. Evaluate the following.  X=3,k=2. Find x,y,k. Y= x++ - --k  Y=--k * ++x  Y=x++ - k—  Y=--x + k—  J=4,k=2, find ++k % --j  i=4, j=3, find i++ - j—

 i=4, j=3, find i++ * --j  i=4, j=3, find – I * j++  if a=5 , find x and a where x=++a * --a  if a=5 , find x and a where x=--a * a++  if a=5 , find x and a where x=a-- + ++a  if a=5 , find x and a where x=--a * a++  if a=5 , find a where a=++a * --a  if a=5 , find a where a=--a * a++  if a=5 , find a where a=a-- + ++a  if a=5 , find a where a=--a * a++  int a=5,b=2; float x=8,y=10; a=(x/y)+a/b; b=(ax)/y; x=a-b; Find a,b,x.  x=8,a=4,b=3,c= z=--a * x-b/a++c .find z,x,a,b,c  x=8,a=4,b=3,c= a=--a * x-b/a++c .find x,a,b,c  a=3,d=7,e=2,c=5,b= x=--a * d/e – c++ * b .find a,b,c,d,e,x  x=4,y=3,z= m=++x + --y + z++ + --z. Find m,x,y,z  Write the hierarchy of computation. axx+bx-c/d>=&&z!=15.  int a=1,b=2,c=3,d=4,e; e=a=c!=a==b<=a. Find e.  int a=1,b=2,c=3,d=4,e; e=a+b<b+c>=c/a==da-b. Find e.  int a=1,b=2,c=3,d=4,e; e=((((a+b)/b)-c)d)+a*d. Find e.

  1. Here is list of possible names for variables in C language. Which are valid names and invalid names? If name is invalid, explain why? i) 1999_space ii) _apple iii) iNtEL iv) one_2v) for vi) #12 vii) i.b.m viii) help+me
  2. Write a C program that computes the size of int, float, double and char variables.

PROGRAMMING IN C AND DATASTRUCTURES-15PCD13/

MODULE- 3 QUESTION BANK

C103.1 / C203.1. Achieve Knowledge of design, development of C problem solving skills & Understand the basic principles of Programming in C language.

C103.3./ C203.3. Design and develop modular programming skills.

  1. What is an Array. Explain the declaration and initialization of 1-D array with examples. ( C103.1 / C203.1)
  2. Explain the declaration and initialization of 2-D array with examples. ( C103.1 / C203.1)
  3. Write a program to sort the elements in an array using bubble sort. ( C103.1 / C203.1)
  4. Write a program to search an element in an array using linear search. ( C103.1 / C203.1)
  5. Write a program to search an element in an array using binary search. ( C103.1 / C203.1)
  6. What is a String. Explain how to declare and read a string with an example. ( C103.1 / C203.1)
  7. Explain string handling functions with syntax and example program for each. ( C103.1 / C203.1)
  8. Explain array of strings in detail with example program. ( C103.1 / C203.1)
  9. Write a program for the following without using string handling functions. ( C103.1 / C203.1) i)string copy ii)string concatenation iii)string comparison iv)string reverse v) string length.
  10. Write a C program to read N integers into an array A and to a) Find the sum of odd numbers b) Find the sum of even numbers c) Find the average of all numbers Output the results computed with appropriate headings. ( C103.1 / C203.1)
  11. Define Function. Explain the elements (function call, function definition, function prototypes) of user defined function. ( C103.3 / C203.3)
  12. Give the different categories of function and explain each with an example. ( C103.3 / C203.3)
  13. Explain Scope of a variable and its types with example. ( C103.3 / C203.3)
  14. Explain the various parameter passing techniques with example. ( C103.3 / C203.3)
  15. Give the difference between the two parameter passing techniques. ( C103.3 / C203.3)
  16. Explain passing arrays to function with example. ( C103.3 / C203.3)
  17. Explain Recursion function with example. ( C103.3 / C203.3)
  18. What are actual and formal parameters? Give the difference between them and also explain each with an example. ( C103.3 / C203.3)
  19. Design and develop a C program to compute the factorial of a given number using recursion. ( C103.3 / C203.3)
  20. Design and develop a C program to compute the Fibonacci series of a given number using recursion. ( C103.3 / C203.3)
  21. Design and develop a C program to compute the sum of n elements of a single dimensional array using function. ( C103.1 / C203.1)
  22. Write a program to compute the sum of 2 2D array using function. ( C103.1 / C203.1)
  1. What is function? Write a C program to find cube of a Number using function. ( C103.3 / C203.3)
  2. Write a C program to check a number is a prime number or not using recursion. ( C103.3 / C203.3) 25. Write a C Program to find greatest number from two dimensional array. ( C103.1 / C203.1) 26. Write a program to replace each constant in a string with the next one except letter ‘z’ ‘Z’ and ‘a’, ‘A’. Thus the string “programming in C is fun” should be modified as “Qsphsannjoh jo D jt gvo”. ( C103.1 / C203.1)

Module 5

Question Bank

  1. Define pointer variable. Explain with example the declaration and initialization of pointer variable.
  2. Explain the various operation using pointers.
  3. Explain character pointer with example.
  4. Write a c program to read and print array elements using pointers (Array of pointer).
  5. Develop a c program to read two numbers and functions to swap these numbers using pointers.
  6. Explain the functions used with dynamic memory allocation with syntax and example.
  7. Explain preprocessor directives with example.
  8. Explain primitive and non-primitive datatypes and explain the types of non primitive datatypes.
  9. Explain stack, its operation and application.
  10. Explain queues, its types, operation and applications.
  11. Explain link list, its types, operation and application.
  12. Explain trees, its operation and application.
  13. Write a c program to read n unsorted number to an array of size n and pass the address of this array to a function to sort the number in ascending order using bubble sort.