--Your friends at LectureNotes

Previous Year Exam Questions of Programming in C of bput - C by Verified Writer

  • Programming in C - C
  • 2017
  • PYQ
  • Biju Patnaik University of Technology BPUT - BPUT
  • Computer Science Engineering
  • B.Tech
  • 180 Offline Downloads
  • Uploaded 1 year ago
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-1

Registration No: Total Number of Pages: 02 B.Tech. 15BE2105 1st Semester Regular/Back Examination 2017-18 PROGRAMMING IN C BRANCH: AERO, AUTO, BIOTECH, CHEM, CIVIL, CSE, ECE, EEE, ELECTRICAL, ETC, FAT, IEE, IT, MECH, METTAMIN, MINERAL, MME, PE, PLASTIC, TEXTILE Time: 3 Hours Max Marks: 100 Q.CODE: B1157 Answer Question No.1 and 2 which are compulsory and any four from the rest. The figures in the right hand margin indicate marks. Q1 a) b) c) d) e) f) g) h) Answer the following questions: multiple type or dash fill up type Which of the following is a User-defined data type? a) typedef int Boolean; b) typedef enum {Mon, Tue, Wed, Thu, Fri} Workdays; c) struct {char name[10], int age}; d) all of the mentioned C programs are converted into machine level language with the help of a) A Compiler b) An Editor c) An Operating System d) None of these Which of the following is an invalid if-else statement? a) if (if (a == 1)){} b) if (func1 (a)){} c) if (a){} d) if ((char) a){} Which loop is most suitable to first perform the operation and then test the condition? a) for loop b) while loop c) do-while loop d) none of the mentioned Which of the following cannot be static in C? a) Variables b) Functions c) Structures d) None of the mentioned Which of the following is a correct format for declaration of function? a) return-type function-name(argument type); b) return-type function-name(argument type) {} c) return-type (argument type)function-name; d) all of the mentioned Which is an indirection operator among the following? a) & b) * c) -> d) . Comment on the following statement: int (*a)[7]; a) An array “a” of pointers. b) A pointer “a” to an array. c) A ragged array. d) None of the mentioned (2x10)

Text from page-2

i) j) Q2 a) b) c) d) e) f) g) h) i) j) Q3 a) FILE reserved word is a) A structure tag declared in stdio.h b) One of the basic datatypes in c c) Pointer to the structure defined in stdio.h d) It is a type name defined in stdio.h Strcat function adds null character a) Only if there is space b) Always c) Depends on the standard d) Depends on the compiler Answer the following questions: Short answer type C is a structured programming language? Justify. Write a ‘C’ program to find the largest among two numbers using Conditional Operator. What is difference between while and do-while loops? Discuss about switch statement with an example. Differentiate between call by value and call by reference. What is the difference between assignment and equality operation? What are the limitation of array ? Give an example of structure inside another structure. How is a file pointer declared? Differentiate between binary file and text file. (2x10) (10) b) Define keyword and identifier in C. What is data type? Explain about different data types with examples. What are variables and constants? What are the rules for declaring the variables? Q4 a) b) Explain different types of operators used in C ,with suitable examples. Write a program in C to find the factorial of a given number. (10) (5) Q5 a) Differentiate between Continue and Break statement. Write a C program to calculate the grade of a student by considering the following range of marks using switch-case statement. O, 90 ≤ Marks ≤100 E, 80 ≤Marks < 90 A, 70 ≤Marks < 80 Grades= B, 60 ≤Marks < 70 C, 50 ≤Marks < 60 D, 40 ≤Marks < 50 F, Otherwise Write a program in C to print count the odd numbers present in between 1 to 100. (10) (10) b) Explain about different parameter passing mechanisms in function with examples. Write a program to find the greatest among 3 numbers using function. Q7 a) b) Explain about different string manipulation functions with examples. Write a program to find given string is palindrome or not. (10) (5) Q8 a) What do you mean by Array? Explain with suitable diagram that ,how the array variables are stored in memory ? Write a program in C to add two 3 dimensional matrices. Write a program to swap two numbers using pointer concept. (10) Explain about different file operations that can be performed on files. How to read from and write to a file? Explain with examples. Differentiate between Structure and Union with suitable example. (10) b) Q6 a) b) Q9 a) b) (5) (5) (5) (5) (5)

Lecture Notes