Categories
Important question news

CS3251 Programming in C Important Questions

CS3251 Programming in C

Important Questions

Unit 1 Part B

  1. Discuss the structure of C program in detail and explain with simple hello world program.
  2. Explain the terms variables and constants. How many types of variables are supported by C.
  3. What is purpose of Decision Control Statements in C? Explain any two of such types with the general form of simple statements.
  4. What are the functionalities of Preprocessor and Compiler? Explain with a simple example.
  5. Elaborate the various Data types in C with suitable examples
  6. Find the output of the following C code. Discuss the steps of execution.  for(i=1,j=1; i<=10; ++i, ++j) {
    if ( i ==3 { continue;}
    else {
    if ( j ==4) {break;} tree.
    else {
    printf(“\ I am in loop, the values of I and J are: %d, %d”, i,j);
    }
    }
    }
  7. Write a C program to get age and vaccination detail as input. Print “Senior Citizen and Eligible for Booster” if age > 60 and vaccination input as ‘2’. Otherwise print “Below 60, and Eligible for Vaccination”. Use Conditional Operator.
  8. Is it possible to convert ‘if-else’ ladder to ‘switch…..case’ statement? If yes, illustrate with an example. If no, justify the reason
  9. Explain the various data types being supported by C language.
  10. Explain about the various looping statements available in ‘C’ with appropriate sample programs.

Unit 2 Part B

  1. Compare one dimensional and two dimensional array. Explain the use of multi-dimensional arrays with syntax and example.
  2. Explain the four string functions with suitable examples.
  3. Write an algorithm to sort an array of integers in ascending order using selection sort and find its time complexity.
  4. Write a simple binary search program using an iterative method.
  5. Write the string handling function used to do the following.
    If first name, last name and middle name are given as input, display it as full name.
    Display the number of characters in full name.
    Convert the first name into capital letters and last name into small letters.
    Print the full name in reverse order.
  6. In a restaurant, the tables are arranged in a room row-wise order. A waiter is assigned to serve food for each row. Write a C program to find the highest bill served by each waiter.

Unit 3 Part B

  1. Write different types of functions with respect to return type arguments and explain all types with syntax and example.
  2. Explain the header file that contains various methods for performing mathematical operations.
  3. Discuss call by value and call by reference with some simple program.
  4. What is a recursive function? Write a simple binary search algorithm using recursive functions.
  5. Write a C program to create two 2D arrays using array of pointers. First 2D array consists of a list of employee names and the second 2D array consists of their designation. Your code should display the designation when name is entered.
  6. Give an example for a function that receives parameters and returns no value.
  7. Create an array of lucky ticket numbers announced for prize bonanza. Get a ticket number and check it for prize and display the result. Use pointer to array concept.
  8. Differentiate between ‘Pass by value’ and ‘Pass by reference’ with an example.

Unit 4 Part B

  1. Give an example for the following:
    (1)Nested structure
    (2) Self-referential structure
  2. List the operations on Linked list. Explain insertion at end and deletion at beginning of a Singly linked list.
  3. Distinguish between calloc() and malloc() functions.
  4. Explain in detail about the dynamic memory allocation process and list memory allocation/deallocation functions.
  5. Discuss the concepts, advantages of self-referential structures and its types and explain with an example program.
  6. Explain the need for nested structures with appropriate example program.
  7. Can a linked list grow dynamically? Justify your answer with example C program.
  8. With suitable diagram, explain the concept of singly linked list.
  9. Enumerate the difference between structure and union with example.

Unit 5 Part B

  1. How does random accessing of files are done in C language? Explain in detail.
  2. What is the purpose of the variables arge and argv of command line arguments in C language? Explain with a sample program.
  3. Write a C program to create a binary file in C named “application.txt” that has the data such as citizen name, aadhar number, pan number, employment, gender and age. Filter the application by analyzing the gender and employment and move all the male applicants who are self-employed into another file called “reject.txt”. Assume minimum 10 candidates.
  4. What is File Organization? Explain its types with pros and cons.
  5. What is a File and list any five operations that can be performed on a file.
  6. What are command line arguments in C? Explain with a suitable program.
  7. When to use fread() and fwrite() functions in file processing?
  8. List down the modes in which a C file can be opened. Specify the purpose of each mode.

Leave a Reply

Your email address will not be published. Required fields are marked *