Professional Documents
Culture Documents
Note: Attempt all five questions as per given internal choice. Each question carries 20 marks.
ii. The word ____________comes from the name of a Persian C113.1 L2 1.4.1
mathematician Abu Jafar Mohammed ibn-i Musa al Khwarizmi.
OR
ii. Draw a flow chart to add two numbers entered by an user. C113.1 L2 1.4.1
OR
c) i. Write an algorithm to find all the roots of a quadratic equation (10) C113.1 L3 1.4.1
ax 2 + bx + c = 0
OR
OR
i. Draw a flow to find the largest among three different numbers C113.1 L2 1.4.1
entered by user.
OR
ii. Differentiate between while loop and do while loop. C113.2 L2 1.4.1
OR
ii. Differentiate between break and continue. C113.2 L2 1.4.1
c) i. Write a C program to input electricity unit charges and calculate total (10) C113.2 L3 1.4.1
electricity bill according to the given condition:
For first 50 units Rs. 0.50/unit
For next 100 units Rs. 0.75/unit
For next 100 units Rs. 1.20/unit
For unit above 250 Rs. 1.50/unit
An additional surcharge of 20% is added to the bill.
OR
i. Write a C program to enter any number and print its reverse. C113.2 L3 1.4.1
OR
i. Write a C program to display the pyramid pattern. C113.2 L3 1.4.1
*
***
*****
*******
*********
3 a) i. What will happen if in a C program you assign a value to an array (4) C113.3 L2 1.4.1
element whose subscript exceeds the size of an array?
OR
i. What is the importance of null character in strings? Explain with C113.3 L2 1.4.1
Example.
ii. Write a C statement to declare and initialize a matrix of 2 rows and 4 C113.3 L3 1.4.1
columns and display the value of 2nd row 3rd column.
OR
ii. Write a C statement to declare and initialize a matrix of 4 rows and 2 C113.3 L3 1.4.1
columns and display the value of 3rd row 2nd column.
c) i. Write a C code to Sort the elements of an integer using Selection Sort. (10) C113.3 L3 1.4.1
Demonstrate the working of Selection Sort technique.
OR
i.Write a C program to display the diagonal elements of a square matrix. C113.3 L3 1.4.1
OR
ii. The keyword used to transfer control from a function back to the C113.4 L2 1.4.1
calling function is_____________.
iii. A function that calls itself is called a ___ function. C113.4 L2 1.4.1
OR
OR
c) i. Write a program using function to calculate the factorial value of any (10) C113.4 L3 1.4.1
integer entered through the keyboard.
OR
i. Write a c program to swap two integers using call by value and call by C113.4 L3 1.4.1
reference.
OR
int main()
{
char *ptr="*&*&*(ptr+1)";
printf("%c",*&*&*(ptr+1));
return 0;
}
ii. What will be the final value of 'a'? C113.5 L3 1.4.1
#include <stdio.h>
void fun(int*);
int main()
{
int *ptr, a=5;
ptr= &a;
fun(ptr);
return 0;
}
void fun(int *p)
{
printf("%d",(*p)++);
}
iii. What will be the output of the C code: C113.5 L3 1.4.1
#include <stdio.h>
int main()
{
struct stud
{
int roll;
char name[30];
}s;
strcpy(s.name,"CoronaVirus");
printf("Stay safe from %s",s.name);
return 0;
}
iv. The__________ function is used to read a single character from a file C113.5 L2 1.4.1
at a time.
OR
OR
ii. What does the characters "r" and "w" mean when writing programs C113.5 L2 1.4.1
that will make use of files?
OR
i. Create a structure student to store the name, roll no and percentage of C113.5 L3 1.4.1
the student. Enter some values within the structure and print the details
of the student with maximum percentage.
OR