Untitled
Untitled
___________
Q.2 (a) Differentiate: Exit controlled Loop and Entry controlled Loop 03
(b) Explain: 04
a) switch-case statement
b) continue statement
(c) Write a C program to find factorial of a number using recursion. 07
OR
(c) Write a C program to generate first n number of Fibonacci series using 07
recursion.( 0 1 1 2 3 5 8…)
1
OR
Q.4 (a) List any three header file with its usage. 03
(b) Write a program to print following patterns : 04
1
22
333
4444
(c) Define a structure type struct personal that would contain person name, 07
date of joining and salary using this structure to read this information of
5 people and print the same on screen.
Q.5 (a) What is dynamic memory allocation? Show the use of malloc() and 03
calloc() function with their syntax.
(b) What is structure? How it is different from union? Explain nested 04
structure with example.
(c) Write a C program to check whether a number is prime or not. 07
OR
Q.5 (a) Explain following string handling functions: I. strcat() II. strcmp() III. 03
strlen
(b) What is Pointer in C and how it initializes? State its advantages. 04
*******************************
2
Seat No.: ________ Enrolment No.___________
Q.2 (a) Demonstrate the working of bitwise shift and sizeof operator with an 03
example.
(b) Differentiate while and do..while loop. 04
(c) Write a C program to check whether the entered character is alphabet, 07
digit, space or any special character.
OR
(c) Write a C program to print following pattern: 07
1
22
333
4444
Q.3 (a) Find out error(s), if any in the following code and correct it: 03
int main() {
if(10%2==0){
break;
}
}
(b) Examine following code and give output of it. 04
void main(){
int a=0;
while (a<10) {
a++;
if (a%3==1) {
continue;
}
printf (" %d", a);
}}
(c) Write a C program to find factorial of a given number. 07
OR
Q.3 (a) Find out error(s), if any in the following code and correct it: 03
int main() {
printf(“%f %d”, 7.0%5.0, 5 || -2);
}
(b) Examine following code and give output of it. 04
void main(){
int i=1;
1
for (i=10; i>=1 ; --i) {
printf (“ %d”, i);
i--;
}
}
(c) Write a C program to make sum of digits of a given number. (if input is 07
145, output should be 10)
2
Seat No.: ________ Enrolment No.___________
Q.1 Mark
(a) Answer the following questions 03
1. Define: Compiler
2. Justify, 2 and ‘2’ both are not same in C language.
3. What is the role of sizeof operator in C language?
(b) Answer the following questions 04
1. Ternary operator can be nested. (True/False)
2. What do you mean by enumerated data type in C language?
3. What is the difference between char *p and char p[]?
4. What do you mean by function prototype?
(b) Answer the following questions 07
1. Define Algorithm.
2. What do you mean by recursion?
3. What do you mean by program and program control?
4. What is a pointer?
5. What is the role of getc( ) and getw() file functions?
6. Programming needs logic building. Justify
7. Define Interpreter.
(c) Explain the working of various bit-wise operators with the example. 07
OR
(c) List out all various string functions and describe them with syntax and 07
example.
Q.3 (a) Explain ternary (?:) operator in detail with the example. 03
(b) Discuss the need of break and continue statements with example. 04
(c) Design a flowchart for checking whether a given number is palindrome or not. 07
OR
Q.3 (a) What is meant by array of pointers? Explain it with example. 03
(b) Write a program to print the triangle shown below. 04
A
AB
ABC
ABCD
(c) Draw block diagram of computer system and explain the functions of each 07
component in detail.
(c) Explain one dimensional array, two dimensional array and multi-dimensional 07
array with their syntax and example.
OR
Q.5 (a) Differentiate call by value and call by reference. 03
(b) Explain structure within structure with example. 04
OR
Q.5 (a) Define Union in ‘C’ with example. 03
(b) Define dynamic memory allocation. Explain malloc() and calloc(). 04
(c) Explain the following File Handling functions: 1. fseek( ) 2. ftell( ) 3. fread( ) 07
4. fwrite( ) 5. fscanf( ) 6. fprintf( ) 7.rewind( )
***********
Seat No.: ________ Enrolment No.___________
Marks
Q.1 (a) Define following terms: 04
1) Application Software 2) System Software
3) Algorithm 4) Flowchart.
(b) Draw the flow chart to find the largest of the given three numbers – 03
A ,B and C
Q.2 (a) Discuss use of break and continue statement in C with example. 03
(b) Compare and contrast while and do while loop with example. 04
(c) Write a C program to print following pattern. 07
1
2 2
3 3 3
OR
(c) Write a C program to print following pattern. 07
1
2 3
4 5 6
Q.4 (a) What is structure? Explain with example how to declare a structure 03
and how to initialize it.
(b) Explain following string manipulation function. 04
strcat( ), strcpy( ) ,strcmp( ) and strlen( )
(c) Write a program in c for multiply two matrices A and B of dimensions 07
pXq and qXr respectively and store the result in third matrix C.
OR
1
Q.4 (a) Demonstrate declaration and initialization of two dimensional 03
array with suitable example.
(b) Explain nested if else ladder with suitable example. 04
(c) Write a program in c using structure to enter rollno, marks of the three 07
subject for 3 student and find total obtained by each student
Q.5 (a) What do you mean by recursive function? What care must be taken 03
while writing a program with recursive function?
(b) Explain fopen() and its mode with example. 04
(c) Describe different categories of user-defined functions. 07
OR
Q.5 (a) What is pointer? Explain how pointers are declared and 03
initialized. .
(b) Compare malloc() and calloc() functions for dynamic memory 04
allocation.
(c) Develope a program in C to check the entered number is prime or not 07
by creating a user-defined function named check_prime().
********
2
Seat No.: ________ Enrolment No.___________
Marks
Q.1 (a) Explain different symbols used in flowchart. 03
(b) Write algorithm or flowchart for finding maximum out of three numbers 04
entered by user.
(c) Explain different categories of operators available in C programming. 07
Q.2 (a) Explain entry controlled and exit controlled loop with proper syntax. 03
(b) Explain 1) nested if-else statement 2) break statement. 04
(c) Write a program to store 10 elements in array given by user and to find 07
maximum out of those 10 elements.
OR
(c) Write a program to find a character from the string, string and character to 07
be searched both will be given by user.
*******************
2
Seat No.: ________ Enrolment No.___________
MARKS
***********
Seat No.: ________ Enrolment No.___________
Q.2 (a) What are header files? Name at least 3 with its usage. 3
(b) Write a program to find 1+1/2+1/3+1/4+....+1/n. 4
(c) What is a string? Explain at least 4 built-in string functions with example. 7
OR
(c) What is an array? Explain one dimensional and two dimensional array declarations
7
and initialization with suitable example.
Q.3 (a) What is formatted output? Using printf() statement explain it. 3
(b) Write a program to check whether entered character is vowel or not? 4
(c) Write a program to print all Armstrong numbers in a given range. Armstrong
number is equal to sum of cubes of its individual digits. For example 153 = 1^3 + 7
5^3 + 3^3. So, 153 is Armstrong number.
OR
Q.3 (a) Why it is necessary to give the size of an array in array declaration? 3
(b) Explain break and continue with suitable example. 4
(c) Write a program to display transpose of given 3*3 matrix. 7
Q.4 (a) What is pointer? Which arithmetic operations are not valid on pointers? 3
(b) Explain array of pointers with suitable example. 4
(c) Write a program to calculate nCr using user defined function. nCr = n! / (r! * (n-r)!) 7
OR
Q.4 (a) What is pointer? Which arithmetic operations are valid on pointers? 3
(b) What is pointer to pointer? Write suitable example to demonstrate the concept. 4
(c) What is recursive function? Explain with suitable example. 7
Q.5 (a) What care must be taken while writing a program with recursive function? 3
(b) Explain how structure variable is initialized with suitable example. 4
(c) What are command line arguments? Explain with suitable example. 7
OR
Q.5 (a) In user defined function, what is actual argument and formal argument? 3
(b) Explain with suitable example structure variable and pointer to structure variable. 4
(c) What is dynamic memory allocation? Explain important functions associated with
7
it.
*****************
1
Seat No.: ________ Enrolment No.___________