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/ 4
SONA COLLEGE OF TECHNOLOGY
DEPARTMENT OF CSE U23CPR205-PROGRAMMING IN C QUESTION BANK
Questions
1. Explain the basic structure of a C program with an example
2. Explain the block structure of a C program
3. Write the general structure of C. Explain with an example 4. Write and explain the basic concepts of a C program 5. What is an identifier (variable)? What are the rules to construct identifier (varible)? Classify the following as valid/invalid Identifiers. 6. i) num2 ii) $num1 iii) +add iv) a_2 v) 199_space vi) _apple vii)#12 7. What is variable? List the restrictions on the variable names 8. Define variable. Explain the rules for constricting variables in C language. 9. Define i)variable ii) Constant iii) Associativity iv)Precedence 10. Explain with example, the various constants available in „C‟ language 11. List all the operators used in C. Give examples 12. Explain any five operators used in C language 13. What is an operator? List and explain various types of operators 14. Explain the following operators in C language 15. i) Relational ii) Logical iii) Conditional 16. What is an assignment statement? Give the general form of an assignment 17. statement 18. What are basic data types available in „C‟? Write the significance of each data 19. type 20. Write a C program that computes the size of int, float, double and char variables 21. What is type conversion? Explain two types of conversion with examples 22. What are the formatted input and output functions. Explain with examples 23. Write the guidelines to use scanf() and printf() functions in C language 24. What is the purpose of scanf() and printf() statement ? 25. Write a C program in C to find the area and perimeter of a circle 26. Write a program in C to print the numbers from 4 to 9 and their squares 27. Write a C program in C to find the area and perimeter of a rectangle 28. Write a C program which takes as input p,t,r. Compute the simple interest and 29. display the result 30. Write a C program to find the area of triangle when we know the lengths of all 31. three of its sides 32. Write a C program to find the largest of three numbers using ternary operator 33. What is an expression? Evaluate the following expressions i) 100 % 20 < = 20 – 5 + 100 % 10 – 20 = = 5 > = 1 != 20 34. ii) a + = b * = C - = 5 where a=3 b=5 and c=8 35. Convert the following mathematical expression into C equivalent 36. area= s(s-a)(s-b)(s-c) 37. x = -b + b2-4ac 38. List all conditional control statements used in C. Explain any two with syntax 39. and example 40. Write a C program that reads from the user an arithmetic operator and two 41. operands, perform the corresponding arithmetic operation on the operands using switch statement 42. Implement a C program to find the reverse of an integer number and check whether it is palindrome or not 43. What are unconditional control statements? Explain any two with syntax and example 44. Write a C program to find the biggest of three numbers 45. Explain switch statement with syntax and example 46. List the differences between while loop and do-while loop. write a C program 47. to find sum of Natura numbers from 1 to N using for loop 48. Write a C program to find the factorial of a number using do-while ,where the number n is entered by user. 49. What is two way selection statements? Explain if, if else, and cascaded if-else with examples. 50. Write a C program that takes from user an arithmetic operator („+‟, „-„, „*‟, or „/‟) and two operands . Perform corresponding arithmetic operation on the operands using switch statement 51. Explain with example ,the meaning of statement and block in a „C‟ program 52. Write a „C‟ program to demonstrate the use of unconditional goto statement 53. Explain with syntax ,if, if-else and nested if-else statements in „C‟ program 54. Explain with syntax , the different loops used in „C‟ program 55. Write a program in „C‟ to find the sum of „n‟ natural numbers without using any loops 56. Write a C program that takes three coefficients (a,b,and c) of a quadtatic equation ; (ax2+bx+c) as input and compute all possible roots and print them with appropriate messages. 57. Show how break and continue statements are used in a C program, with example 58. Explain with examples formatted input output statements in C 59. Write a C program to find GCD of two numbers using ternary operator and for loop 60. Write a calculator program in C language to do simple operations like addition, subtraction, multiplication and division. Use switch statement in your program 61. What is dangling else problem? Explain how to handle this in C programming 62. What is array ? Explain the declaration and initialization of one dimensional and two dimensional array with an example 63. Define array.Explain with suitable example how to declare and initialize 1D array 64. Write a C program to read N integers into an array A and to find the (i)sum of odd numbers,(ii) sum of even numbers,(iii) average of all numbers. Output the results computed with appropriate headings 65. Write a C program to search an element using linear and binary techniques 66. Write a C program for [consider integer data] (i) Bubble sort (ii) Linear search 67. Write a C program to read N numbers into an array & perform Linear search 68. Write an algorithm and develop a C program that reads N integer numbers and 69. arrange them in ascending order using selection Sort 70. Write an algorithm and develop a C program to search an integer from N numbers in ascending order using binary searching technique 71. Write a C program to find the transpose of a given matrix 72. Write a C program that accepts (3×3 ordered matrices A and B),and compute 73. the following (i)summation of Two numbers (ii) Subtraction of Two numbers 74. Write a C program to find the sum and average of n integer numbers 75. Write a C program to find the largest element in an array 76. Write a C program to find the greatest number from two dimensional array 77. Write a C program to sort the elements by passing array as function argument 78. Define string. How string is declared and initialized ? Explain string input/output functions with an example 79. What is string ? Write a C program that reads a sentence and prints the frequency of each of the vowels and total count of consonants? 80. Write a C program to eliminate multiple spaces from a sentence and make it single 81. Explain with syntax and example ,the different string manipulation library functions with example 82. Define a string. Explain any 4 string library functions with syntax and example 83. Explain string manipulation library functions with their syntaxes 84. Define string. List out all string manipulation function. Explain any two with example 85. Write a C Program to implement string copy operation STRCOPY(str1,str2) that copies string str1 to another string str2 without using library function 86. Write a C program to copy a string ( combination of digits and alphabet ) to another string (only alphabets) 87. Write a program to replace each constant in a string with the text 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”. 88. Write a C program to concatenate two strings without using built-in function strcat() 89. Explain with example (i) Character string (ii) String literal (iii) storage classes 90. How string is declared and initialized? Explain any four string manipulation functions with examples 91. Write a C program to check whether the given string is palindrome or not without using in built function 92. Write a C program to search a name in a given list using binary search technique 93. What is function ? Explain the difference between user defined and library functions 94. Explain the different elements of user defined functions in detail 95. Explain function call, function definition and function prototype with examples 96. What is function? Write a function to find the sum of two numbers 97. Explain two categories/types of argument passing techniques, with examples 98. Differentiate between call by value and call by reference with examples 99. Explain the classification of user defined functions 100. Define a function. List and explain the categories of user defined functions 101. What is function? Explain the type of functions based on parameters 102. What is function? Explain different classification of user defined functions 103. based on parameter passing and return type with examples 104. Write a C function isprime(num) that accepts an integer argument and returns 1 if the argument is a prime or 0 otherwise. Write a program that invokes this function to generate prime numbers between the given ranges 105. Write a c-program using function to check whether the given number is prime 106. or not. 107. Write a program in „C‟ using functions to swap two numbers 108. Write a program in C using functions to swap two numbers using global 109. variables concept and call by reference concept. 110. What are actual parameters and formal parameters? Illustrate with example 111. Write a C program to find the factorial of a number using functions 112. Write a program to find GCD and LCM of two numbers using concept of functions 113. Give the scope and life time of the following 114. (i)External variable (ii) Static variable (iii) Automatic variable (iv) Register variable 115. What are the three possibilities of defining a user defined functions in „C‟? 116. What is Recursion? Write a C program to compute polynomial co-efficient nCr using recursion 117. Write a C program for evaluating the binomial coefficients using a function factorial(n) 118. Write a C program to find the binomial co-efficient a number using recursion 119. Define a recursion . Write a C recursive function for multiplying two integers 120. where a function call is passed with two integers m and n 121. Write a C program to check a number is a prime or not using recursion 122. Write a C program to find the factorial of a number using recursion 123. Explain recursion. and write a program to find nth term of Fibonacci series 124. What is structure? Explain the C syntax of structure declaration with example 125. Explain array of structure and structure within a structure with an example 126. Write a C program to maintain a record of „n‟ students details using an array of structures with four fields(roll no,name,marks,and grade).Assume appropriate data type for each field. Print the marks of the student given the student name as input. 127. Write a C program to pass structure variable as function argument 128. Write a C program to store and print name, USN, subject and IA marks of students 129. using structure 130. Explain the difference between array and structures 131. Explain with example how to create a structure using „typedef‟ 132. Write a program to maintain a record of „n‟ employee detail using an array of structures with three fields(id, name , salary) and print the details of employees whose salary is above 5000 133. What is pointer ? Explain how the pointer variable declared and initialized? 134. Explain the array of pointes with example? or Explain how pointers and arrays are related with example 135. What is a pointer? Write a C program to find the sum and mean of all elements in an array using pointer 136. Write a C program to swap two numbers using call by address(pointers or reference) method 137. Write a C program using pointers to compute the Sum, Mean and Standard deviation of all elements stored in an array of „n‟ real numbers 138. What is pointer? give the advantages and disadvantages of pointer data type 139. What is preprocessor directive? Explain #define and #include preprocessor directives 140. Explain any five preprocessor directives in C 141. List and explain compiler control directives 142. What is a macro ?Write a macro to determine whether the given number is odd or even 143. Write a „C” program to define macros for logical operators 144. What is a file?Mention the types of file 145. List out the file functions in C With example 146. What are the basic file operation in C? 147. Explain the inbuilt file handling functions 148. Explain all modes of file operations. 149. Difference between fprintf() ,fputc(),fputs(). 150. Write a C program to read to content of one file and to copy the same into the other file. 151. Write a C program to store and read the records of the student(Stud_id,name,submarks) in a file using structure. 152. What is sequential and random access file with example? 153. Write a C program to add 2 numbers using command line argument and explain appropriately