C PROGRAMMING
MULTIPLE CHOICE QUESTION
OLD QUESTION BANK
SAMPLE QUESTION 2080 AND SOLUTION

ASSIGNMENT 7-ARRAY , STRING AND POINTER

 

ONE DIMENSIONAL ARRAY

  1. WAP that reads 10 integers from the keyboard , stores them in an array and displays entered numbers on the screen.
  2. WAP to illustrate the memory location allocated by each array element.
  3. WAP  that reads marks percentage in an examination of 10 students . Calculate and display the average marks.
  4. WAP to sort n numbers in ascending / descending order.
  5. WAP to search an element in an array and display the index of it.
  6. WAP that ask for  numbers from users , store them in an array and find the maximum and minimum number of them.
  7. WAP to read marks of n students and print out top five .
  8. WAP to read an array of length N. Display the total count for positive number , negative numbers and zeros separately.
  9. WAP to read n numbers from the keyboard and store them in an array. Add even numbers and odd numbers separately and display the result. 
  10. WAP to read n numbers in an array . Pass this array to a function which finds and displays the sum of even numbers only and the product of odd numbers only.

 

TWO DIMENSIONAL ARRAY

  1. WAP to initialize a 2-D array and display its elements.
  2. WAP to read a matrix of size 2*3 from the user and display it on screen.
  3. WAP to read two m*n matrices and display their sum.
  4. WAP to illustrate passing an array to function one element at a time.
  5. WAP to illustrate passing an entire array to a function.
  6. WAP to read 10 numbers and reorder them in ascending order using function sor(),read(), display().
  7. WAP to define three user defined function for reading , processing and displaying of 2*3 matrices . Double the matrix element and display it. 
  8. WAP to read the order of the matrix and its elements . Find the transpose matrix of the matrix.
  9. WAP to read the order of a square matrix and its elements from the keyboard. Find the sum of diagonal elements of the matrix.
  10. WAP that asks the order of two matrices and read these matrices from user . Find the product matrix if order of matrices is suitable for multiplication.
  11. WAP to read the order of two matrices from the user . Read elements of the matrices using function and then find product of matrices . Finally , display the resultant matrix using another function.


 

STRING

  1. WAP to read the name of 5 different people using an array of strings and display them.
  2. WAP to find out the length of string input from the user using the library function strlen() function.
  3. WAP to copy one string to another using strcpy() function.
  4. WAP to concatenate two strings using strcat() function.
  5. WAP to illustrate the use of strcmp() function.
  6. WAP to illustrate the use of strrev() function.
  7. WAP to read a string and check whether it is palindrome or not
  8. WAP that reads a string from the keyboard until the user presses an enter key and counts the vowels , consonants, semicolons,commas separately in the string.
  9. WAP to read the names of five persons and sort them to display in ascending order.
  10. WAP to concatenate two strings without using string handling built-in functions.
  11. WAP which reads your name from the keyboard and displays a list of ASCII codes which represent your name.
  12. WAP that takes a string from the user and passes it to a function . The function should find and return the number of words in the string. In the main program, display the  number of words.
  13. WAP to read a string and search a specified word in the given string.
  14. WAP to reverse string using recursive function with swapping.
  15. WAP to display the following pattern

Enter a string: COMPUTER

C

CO

COM

COMP

COMPU

COMPUT

COMPUTE

COMPUTER

 

Enter a string: HELLO

H

HE

HEL

HELL

HELLO

HELL

HEL

HE

H

 

Enter a string: KNOW

K

KN

KNO

KNOW

NOW

OW

W

 

Enter a string: PROGRAM

      P

     PR

    PRO

   PROG

  PROGR

 PROGRA

PROGRAM

 ROGRAM

  OGRAM

   GRAM

    RAM

     AM

      M

 

Enter a string: PROGRAM

Enter number of rows: 5

      P

     R O

    G R A

   M P R O

  G R A M P

 R O G R A M


 

Enter a string: KNOWPROGRAM

Enter number of rows: 9

         K

        N O

       W P R

      O G R A

     M K N O W

    P R O G R A

   M K N O W P R

  O G R A M K N O

 W P R O G R A M K

N O W P R O G R A M

POINTER

  1. WAP to initialize an one - dimensional array and display its elements with their memory address using array name as a pointer.
  2. WAP to read marks of 10 students secured in a subject and store them in an array using pointer notation. Calculate average marks of them and display them on screen.
  3. WAP to define two matrices of order m*n using pointer notation. Read elements of the matrices from the user and add them and display the sum using a pointer.
  4. WAP to define two matrices of order m*n using pointer notation. Read elements of the matrices from the user and multiply  them and display the product using a pointer.
  5. WAP to swap the value of two variables using pointer notation or call by reference.