We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5
MCA CT103-Structured programming in C
SAMPLE QUESTIONS-UNIT WISE
UNIT 1
1. Write the features of C language.
2. What is the character set in C language? 3. What is an identifier? 4. Explain keywords in C. 5. List the special characters in C 6. What do you mean by a data type? 7. Compare constant and variable. 8. Differentiate single character constant and string constant. 9. How do variables and symbolic names differ? 10. Describe the characteristics of escape sequence characters. 11. What is the purpose of using getchar() function? 12. How can we format the input using scanf() function? 13. How does a control string in a printf() function differ from scanf() function? 14. Write notes on putchar() function. 15. Describe the features of structured Programming. 16. Explain C Tokens in detail. 17. Classify the data types in C 18. Describe operators in C with suitable examples 19. Describe type conversions in detail. 20. Write note on C Character Set. 21. Mention the use of typedef keyword? 22. Explain the basic structure of C Program 23. With examples discuss the following arithmetic operators in C language. 24. Write a C program to find the roots of a Quadratic Equation. 25. Illustrate the pre-processor directives.
UNIT 2
1. Explain if-else statement with syntax and examples
2. What is nested if statement? 3. Distinguish automatic variables and global variable. 4. What is switch statement? 5. Explain jumping statements in C. 6. Define Looping. 7. Explain the working of while statement 8. Compare while and do-while statements 9. Explain the working of for statement 10. What is nested loop? How does it work? 11. What is a function? What are the advantages of using functions? 12. Write the syntax of function definition and explain it. 13. What is function prototype 14. What is the need of return statement? 15. What is function call statements? 16. Differentiate actual arguments and formal arguments 17. What do you mean by call by value? 18. How can you pass arguments to a function? 19. What is recursion? What are the criteria required to solve a problem recursively? 20. Discuss switch statement with sample program. 21. Explain various storage classes in C 22. Explain different types of user defined function with proper examples 23. How to pass arguments to functions? Explain 24. Explain the use of break and continue statements in C with proper examples 25. Explain how can you access different types of user defined functions and return values to the calling function.
UNIT 3
1. Define array with appropriate examples.
2. Explain how to represent an array using c program. 3. Describe the various array operations. 4. Define an array to store marks of 30 students in 3 subjects. 5. Explain with suitable example how to declare and initialize 1Darray 6. Describe multidimensional array with example. 7. Explain the declaration and initialization of two-dimensional array with example. 8. Write a program to find the smallest and biggest element in an array. 9. Write a C program that find the sum of diagonal elements of matrix. 10. Write a C program to read N numbers into an array & perform Linear search 11. Illustrate searching operation in an array. 12. Differentiate row major and column major representation of array. 13. Define string. How string is declared and initialized? 14. Explain with example string representation in C language. 15. Differentiate between the use of puts () and gets () function. 16. Write a C program to check whether two strings are equal without using string functions. 17. Develop a program to reverse a string without using string functions. 18. Write a program to read a line of text and output the number of words and characters in it. 19. Discuss on various string handling functions available in C? 20. Explain any one application using two-dimensional array. 21. Compare array and variables. 22. Explain the merits of using arrays 23. Discuss on Array of Strings. 24. Write a program to insert and delete an element to a given position using array. 25. Write a program to compare two strings without using string function
UNIT 4
1. Define pointer. What are its benefits?
2. Write a short note on pointer arithmetic. 3. Differentiate between a null pointer and a void pointer. 4. Illustrate the use of & and * operator using a simple example. 5. Give a brief note on comparison of two pointers. 6. Differentiate between call by value and call by reference. 7. Briefly explain on how 1D and 2D array elements can be accessed using pointer notation. 8. Briefly explain array of pointers with an example. 9. Differentiate the declarations int *a [10] and int (*a)[10]. 10. How are pointers passed to functions? Explain. 11. Differentiate between static memory allocation and dynamic memory allocation. 12. Mention the standard library functions supported in C to deal with dynamic memory allocation 13. Explain the concept of pointer to pointer with an example. 14. Differentiate the declarations char str[]=“Mumbai” and char *ptr= “Mumbai” 15. Briefly explain the calloc and realloc functions. 16. Give the syntax for defining the composition of a structure. How are structure variables initialized? 17. Define a structure named info that contains three members (roll - integer, name- a string of 20 characters and percentage - floating point). Declare an instance of type info named student. Give expressions to refer the members of the structure. 18. Explain how a pointer is assigned to a structure and how the members of the structure are accessed using this pointer? Give example. 19. Differentiate Structure and array with examples. 20. Explain the concept of nested structures with an example. 21. Give explanations of the various dynamic memory allocation functions in detail. 22. Create a structure for an employee with following information:- empid, name and salary. Write a program to read the details of ‘n’ employees and display the details of employees whose salary is above 10000. Use array of structures 23. How are pointers declared, initialized and dereferenced? Illustrate with examples. 24. Discuss on self- referential structures. 25. How can you access the elements of a 1D array using pointer notation? Write a program to sort a 1D array of integers using pointer notation.
UNIT 5
1. List out the primary advantage of using a data file?
2. Define stream-oriented and system-oriented data files? 3. How is a buffer area defined in stream-oriented data file? 4. Define stream pointer? 5. What is meant by opening a data file? How is this accomplished? 6. What are the different file types that can be specified by the fopen()? 7. State the purpose of fclose() function? 8. Sate the purpose of library function feof? 9. On what kind of applications the function groups fread, fwrite and fscanf , fprintf are well suited? 10. What are the purpose of the file management functions fseek(), ftell() and rewind()? 11. Define bitwise operations? 12. List the main random access file functions. 13. List three logical bitwise operators? 14.If a and b are unsigned integers whose values are 0x6db7 and 0xa726 respectively, find a^b, a|b, a&b. 15.Define masking operation? 16.What is enumeration? How is an enumeration defined? 17.What are enumeration constants? How we can override these constant values? 18. What are command line arguments? 19. When parameters are passed to a program from the command line, how is the program execution initiated? 20. What is a macro? How it is defined in C? 21. How is multiline macro defined? 22. Write a C program to copy the content of one file to another using command line arguments. 23. Explain the different functions supported in C to read and write data from a file. 24. Write a C program to copy one file content to another file. 25. Write a C program to covert the content of the file from lower case to upper case.