Notessss

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

14.

A) Define all types of conditional expressions with syntax


and Write a menu driven program using switch
case to add, subtract, multiply and divide two numbers. [CO3] IMS ENGINEERING COLLEGE IMSEC/QF/49
B) Explain the following file functions in file operations FORMATS Page 1 of 2
(i) getw() (ii) feof() (iii) fseek() (iv) fscanf() (v) fprintf() [CO4] Issue No: 02
15. A) Explain all mode of operations of file opening with Sessional Question Paper, 2018-19 Issue Date: 1 April, 2010
syntax? Write a program in C to copy the content of a EVEN
Prepared by: MR Approved by: Director
given file say “source.txt” to another
file say “target.txt”. [CO5] Subject Programming for Problem Subject KCS-201
B) Explain the difference between character array and integer Name solving Code
Roll No. of Student Max 100
array. Also define strlen() , strcpy() , strcmp() , strrev(), Marks
strcat() functions With syntax and example. [CO5]
Note: 1) Attempt all questions. All question carry equal marks.
2) Use suitable diagram wherever necessary.
16. A) What do you mean by order of complexity? Explain Section A
various notions to represent order of complexity with 1. Attempt any ten Parts of the following:
diagram. [CO2] (10X2=20)
B) Also write a program to find the following results in file. (a) What will be the output of following code? [CO2]
i. How many vowels in file void main()
ii. How many spaces in file { int i= 1, j=2, k=3;
iii. How many lines in file printf(“%d”,!((j+k)>(i+5))); }
[CO4] (b)What is sizeof() operator? Explain with suitable example. [CO1]
(c) Define algorithm. What are the characteristics of an algorithm? [CO2]
(d) Why does element counting of arrays start from ‘0’? [CO5]
(e) If a=20 and b=15, find the value of the following statement:
a<b? a+5 : b+6 [CO1,CO3]
(f) Differentiate between implicit and explicit type casting. [CO1]
(g) What will be the output of following code? [CO2]
# define product(x) (x*x)
void main( ) {
int i; i= 81/product(9);
printf(“%d”,i); }
(h)What is NULL character? Why is it important? [CO5]
(i) What is pointer with suitable example? [CO5]
(j) WAP to print following sequence: -8 -6 -4 -2 0 2 4 6 8 [CO3]
(k) What is the difference between compiler and Interpreter? [CO2]
(l) Draw flow chart for do-while statement. [CO2]
(m) Explain function prototype with example. [CO4] given number using file inclusion. [CO2]
(n) Explain the following statement:int main(int args, char *argv[])[CO2]
(o) What is the importance of EOF? Explain with example. [CO4]
Section B 8) A) Write a C program to convert number from binary to decimal. [CO3]
Attempt any Five Parts of the following: (5X10=50) B) WAP in C to perform binary search using pointer. [CO4]
2) A) What is linked list? Write the self-referential structure of a node
in linked list. [CO5] 9) A) Explain Enum and typedef with suitable example? Also
B) Draw the block diagram of computer and explain all parts with Explain case control structure with example. [CO2,CO3,CO5]
suitable examples. [CO1] B) Explain selection sort technique. Also write algorithm for
selection sort. Sort the following numbers using selection sort
3) A) What do you understand by data Types? Explain primitive data algorithm. 26, 54, 93, 17, 77, 31, 54, 55, 20 [CO5]
Types in C by giving memory requirements, format specifier,
range and suitable example wherever required. [CO2] 10) A) write a program in ‘C’ to determine whether a string given by
B) Draw the memory hierarchy structure of a computer system. [CO1] the user is palindrome or not. [CO3]
B) What is dynamic memory allocation? Explain the calloc(),
4) A) Write a program to print the following pattern: [CO3] malloc(), realloc() and free() function in detail. What is lifetime
* 1234 of a variable, which is created dynamically. [CO5]
* * 123
* * * 12 11) A) WAP to sort set of integers in ascending order by using bubble
* * * * 1 sort technique. [CO5]
B) Differentiate between while and do while loop with suitable B) What is operating system? Also explain functions of operating
Example. Also Write a program in C to check whether a given system. [CO1]
year is leap year or not? [CO3]
Section C
5) A) Differentiate between actual and formal argument. WAP to Attempt any Two Parts of the following:
create the function to print the table of given number. [CO4] (2X15 =30)
B) Differentiate between call by value and call by reference with
suitable example. Which is more efficient and why? [CO4] 12. A) What is recursion ? Write a program using recursion to
print the n elements of Fibonacci series. [CO3]
6) A) Write a program to check the number is palindrome or not. B) WAP in C to multiply a matrix of dimension 4X4 and store
The program should accept any arbitrary number typed by the result in another matrix. [CO5]
user. [CO3] 13. A) Explain various types of operator in C with the help of
B) What is storage class in ‘C’? Explain different storage classes example. When precedency of two operators in an
supported in C with suitable example. [CO2] expression is same, how associativity helps in
identifying which operator will be evaluated first.
7) A) Write a ‘C’ program to find the sum of following series: [CO3] Illustrarte it with the help of an example. [CO1]
S=X- X3/3 + X5/5 -………..nth term B) Define Structure with syntax. WAP to create a data base of
B) What are Macros? Differentiate between #include<stdio.h> and fifty students to store personal details such as roll no, name
#include”stdio.h”. Also write a program to find the factorial of a
and marks. Print all the details of students whose marks are
more than 70. [CO5]

You might also like