Focp Important Question in Unit IV and Unit V
Focp Important Question in Unit IV and Unit V
Focp Important Question in Unit IV and Unit V
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)