Marks: 25 Duration: 2 hours
1. Design an algorithm, Draw a Flowchart and implement a C Program to test basic operators like Arithmetic, Relational and logical, and Assignment, Read necessary inputs from the user using Input output functions.
2. Design an algorithm, Draw a Flowchart and implement a C Program to read a year as an input and find whether it is leap year or not. Also consider end of the centuries
3. Design an algorithm, Draw a Flowchart and implement a C Program to find real roots of a quadratic equation. Read all necessary inputs using input methods. Display roots and appropriate messages for false conditions. Note: use library function sqrt(n)
4. Design an algorithm, Draw a Flowchart and implement a C Program to
read units consumed for a customer calculate and display the total bill.
An Electric distribution company charges its consumers as follow
Consumption Units Rate
0-200 0.50/unit
201-400 Rs 100 plus Rs 0.60/unit excess of 200
401-600 Rs 230 plus Rs 0.85/unit excess of 400
601-above Rs 390 plus Rs 1.00/unit excess of 600
5. Design an algorithm, Draw a Flowchart and write a C Program for following pattern using C
1
1 2 A
1 2 3 B C
1 2 3 4 D E F
6. Design an algorithm, Draw a Flowchart and implement a C Program to Display user entered number in words. Ex. 5274 Five Two Seven Four. Read the number as input using input function.
7. Design an algorithm, Draw Flowchart and implement a C Program to accept 5, 2 digits numbers from the user and add them. If user enters a three digit number, this number is discarded and again accepted new numbers against to it. Give proper indication about the same to the user that “he has entered 3 digit number” The sum must be displayed at the end.
8. Design an algorithm, Draw a Flowchart and implement a C Program to define function isprime(num) that accepts an integer argument and returns 1 if the argument is prime, a 0 otherwise. Write a C program that invokes this function to generate prime numbers between the given range.
9. Design an algorithm, Draw a Flowchart and implement a C Program to write a recursive C function to find the factorial of a number, n! defined by fact(n)=1, if n=0. Otherwise fact (n)=n*fact(n-1).
10. Design an algorithm, Draw a Flowchart and implement a C Program to cyclically rotate the elements in array. Program should accept a choice in which direction to rotate i.e. left or right. Depending on choice it should perform cyclic rotation.
11. Design an algorithm, Draw a Flowchart and implement a C Program that reads two matrices A (m x n ) and B(p x q ) and Compute the product A and B. Read matrix A and matrix B in row major order and in column major order respectively. Print both the input matrices and resultant matrix with suitable headings and output should be in matrix format only. Program must check the compatibility of orders of the matrices for multiplication. Report appropriate message in case of incompatibility.
12. Design an algorithm, Draw a Flowchart and implement a C Program that Implements string copy operation STRCOPY (str1, str2) that copies a string str1 to another string str2 without using library function.
13. Design an algorithm, a Draw Flowchart and implement a C Program which accepts a sentence and counts the frequency of vowels, consonants, digits and special Symbols.
14. A sport club of cricket needs to maintain data about players. Description of it is given below. Club want to maintain player’s name, age, no of matches played, no of runs, and average. For above description declare a structure and Display data in the descending order of number of runs made. Design an algorithm, Draw a Flowchart and implement a C Program for above problem.
15. Design an algorithm, Draw a Flowchart and implement a C Program to define structure ‘EMPLOYEE’ in C to Store Employee Details like (E_Id, Name, Salary) Create nested structure ADDRESS in EMPLOYEE to store the address information of an employee like (HouseNo, City, Pin). Display The Employee Details.
16. Design an algorithm, Draw a Flowchart and implement a C Program to accept two numbers from the user and swap them. Pass the values to be swapped to the function using call by reference method.
17. Design an algorithm, Draw a Flowchart and implement a C Program to accept and display set of 10 numbers in an array (Use pointers to array concept).
18. Given two university information files “studentname.txt” and “usn.txt” that contains students Name and USN respectively. Write a C program to create a new file called “output.txt” and copy the content of files “studentname.txt” and “usn.txt” into output file in the sequence shown below. Display the contents of output file “output.txt” on to the screen.
Headings
Student Name USN
Name1 USN1
Name2 USN2
...... .......
19. Design Algorithm and implement C program find mean variance and standard deviation of any 5 numbers
20. Design Algorithm and implement C program to accept a number from user and perform following testing’s on the number
a) Check no is Armstrong or not
b) Check number is palindrome or not
(Note: develop user defined functions for above tests)
21. Design Algorithm and implement C program to sort following numbers using bubble sort
45 -93 67 87 92 38 41 23 97 -1
(Note: develop user defined functions for above sorting technique)
22. Design Algorithm and implement C program to perform following operations on String
a) To copy one string in to another
b) To append string
(Note: develop user defined functions for above operations on Strings * Don’t use inbuilt sting functions)
23. Design Algorithm and implement C program to perform following operations on String
a) To count no of words in a sentence or string
b) To reverse string
(Note: develop user defined functions for above operations on Strings * Don’t use inbuilt sting functions)
24. Design Algorithm and implement C program to perform following operations on String
a) To check string is palindrome or not
b) To insert word at specified position in a sentence
(Note: develop user defined functions for above operations on Strings * Don’t use inbuilt sting functions)
25. Design Algorithm and implement C program to perform following operations on String
a) To change case of alphabets in a string (for eg: Computer Engg output: cOMPUTER eNGG
)
b) To parse string to find only digits from string
(Note: develop user defined functions for above operations on Strings * Don’t use inbuilt sting functions)
26. Design Algorithm and implement C program to accept n Numbers in Array and split it in to following 2 arrays.
a) To create an array of only odd numbers
b) To create an array of prime numbers
For Eg: A[]=11 22 33 44 55 66 77 88 99
Output Array:
(Array of Odd Numbers) B[]= 11 33 55 77 99
(Array of Prime Numbers) C[]= 11
27. Design Algorithm and implement C program to accept n Numbers in Array and search an element in it. An element to be search should be accepted from user. Write user define function searchInArray (int element). Display the location (Array index) of an element if found otherwise display appropriate message.
28. Write a program to print addition and average of all elements from each column of a matrix of size 4X4. Accept matrix elements from user.
29. Write a program to show difference following
1) Struct Vs Union
2) Call by Val Vs Call By reference
30. Write a program to copy content of one file in to another and also display the same on consol.
31. Write a program to write record of an employee in a file. Read the same from file and display it on the output screen
(Employee Info: Name, ID, Designation, Salary)
32. A sport club of Hockey needs to maintain data about players. Description of it is given below. Club want to maintain player’s name, age, no of matches played, no of goals. For above description declare a structure and Display data in the descending order of number of goals made. Design an algorithm, Draw a Flowchart and implement a C Program for above problem.
Answer Refer Q.14
33. A Department needs to maintain data about Students of one division. Description of it is given below. Department want to maintain name, Roll no, age, SGPI. For above description declare a structure and Display data in the ascending order of name of the students. Design an algorithm, Draw a Flowchart and implement a C Program for above problem.
Answer
34. Program to implement following patterns in using C up to N Rows
A. Answer
1
0 1
1 0 1
0 1 0 1
1 0 1 0 1
B. Answer
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
C. Answer
0 1 1 1 1
2 0 2 2 2
3 3 0 3 3
4 4 4 0 4
5 5 5 5 0
D. Answer
1
1 2
1 2 3
1 2 3 ....n
E. Answer
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
F. Answer
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
G. Answer
5
4 4
3 3 3
2 2 2 2
1 1 1 1 1
H. Answer
A
AB
ABC
ABCD
ABCDE
I. Answer
A
BB
CCC
DDDD
EEEEE
J. Answer
A
BC
DEF
GHIJ
K. Answer
ABCDE
BCDE
CDE
DE
E
35.More patterns click on answer :-)