You are on page 1of 3

VELAMMAL ENGINEERING COLLEGE DEPARTMENT OF CSE & IT 185102 FUNDAMENTALS OF COMPUTING AND PROGRAMMING Consolidated Question Bank UNIT

T IV AND UNIT V PART A


1. List out the characteristics of a C. 2. What are tokens in C? 3. What is the significance of main function () ? 4. What is a variable and what are the rules for naming a variable? 5. If a=50, b=10 and c=20 , evaluate the following complex expression C+= (a>0&&a<=10)?++a:a/b; 6. Write the difference between of getchar( ) and getche ( ). 7. What is the difference between a and a in C? 8. What is conditional operator? Give general syntax. 9. What is the use of sizeof( ) operator? 10. Write a C program to read two integers and print the smallest among them. Use conditional operator. 11. Illustrate the difference between logical-AND and bitwise-AND with an example. 12. Write a C program to find whether the given number is even or odd. 13. Show the syntax of switch-construct in C. Give an example. 14. Distinguish between while loop and do-while loop. 15. What is the difference between continue and break. 16. What is the difference between scanf and gets function 17. What is the need of global variable in C? 18. Give an example for local and global variables. 19. Define the scope and lifetime of local and global variables. Give examples. 20. Define function and give its syntax. 21. What are the advantages of Functions in C? 22. Define a C function to exchange the content of two variables. 23. List the operations performed with arrays. 24. What are actual and formal arguments? 25. Give an example for call-by-reference. 26. Differentiate between call by value and call by reference.

27. How can you return more than one value from a function? 28. What is meant by recursion? Give an example. 29. Write a C program to find sum of n integers that are stored in an array. 30. Give the syntax for two-dimensional array. 31. Explain with an example how a string is declared and initialized. 32. Mention the difference between character array and integer array. 33. Explain the need for array variables. (2) 34. List the operations performed with arrays. 35. Give the syntax for two-dimensional array 36. Define Register Variables. 37. Give examples for string operations in C. 38. How do you declare pointer variables in C. Give examples. 39. What is the output of the following program? main() { printf (%d%d%d%d\n, A,B,C,D); } 40. Write the missing statement in the following program and output of this program is "This is my value:3.14". #include <stdio.h> #include<conio.h> void main( ) { clrscr( ); XXXXXXXX printf("This is my value: %f \n", f); getch( ); } 41. Give examples for the usage of the following string functions : a) strlen b) strcpy 42. Write the difference between strcmp( ) and stricmp( ). 43. What are the values of x and y after the execution of the following program? main ( ) { int x, y = 8; x = (y++ - y++); printf ("x = %d, y = %d \n") ; }

PART B

1. Explain the structure of C program (8) 2. Explain how constants are defined and used in C programs. Give examples.(8) 3. Describe the features of different data types in C. (8) 4. Explain briefly the formatted and unformatted I/O functions in C. (8) 5. What are the different operators available in C? Explain with examples.(8) 6. Differentiate nested-if-construct from switch-case-construct with suitable examples. (4) 7. Find the output of the following expression: (a) 4+8/2*7+4 (b) 2+6/3*4%3+(5*2) (8) 8. C language provides three constructs for performing loop operations. With relevant examples discuss the same. (16) 9. Write a c program to find the largest of three numbers using if-else conditional Statement.(8) 10. Write notes on storage classes in C. (8) 11. Write a C program to find roots of the quadratic equation (8) 12. Write a program to read 10 numbers from the keyboard and display the number of odd and even numbers entered. (8) 13. Write a C program to calculate the electricity bill. Read the starting and ending values from the meter. The rates per unit are given below. Compute the electricity charges and print the same. (16) No. of Units Consumed Rate per unit in Rs. 200-500 3.50 100-200 2.50 Less than 100 1.50 14. Write a C program to find the factorial of the given number. 15. Write a C program to print the given number in reverse order . (8) 16. Write a C program to verify the given number is a palindrome or not (8) 17. Write a C program to find the sum of the following series (use for-loop-construct).(8) 1+2+3+n 12 + 22 + ...... + n2 18. Write a C program to generate Fibonacci-series up to 100. Use function to compute the next Fibonacci number. (8) 19. Write a C program to evaluate the following series: (8) E = 1+1/1!+1/2!+1/3!++1/n! 20. Give the syntax to declare single dimensional and two-dimensional array. (4) 21. Write a program to find the largest element in an array (8) 22. Write a program to sort N numbers using array (8) 23. What are the advantages of using functions in a program? (4) 24. Explain four types of function prototypes based on arguments. (12) 25. Discuss the concepts of arrays in C. (8 ) 26. Write a C program to search for an element in an array of integers using linear search.(8) 27. Write a C program to find the addition of two matrices. (10) 28. Write a C program to perform matrix multiplication. (8) 29. Write a C program to check whether given string is palindrome or not. (8) 30. Differentiate library functions and user-defined-functions with suitable examples. (8) 31. Explain in detail various string handling functions in C (16) 32. With relevant example discuss the following (8) Call by value and Call by reference Develop a C program to sort N names alphabetically. (16)

You might also like