You are on page 1of 2

Flow control (3)

1. WAP that will display the count of the positive and negative numbers when zero in
entered (e.g. input –> 1,2,3, -1, -2, -3, 0 output- positive number- 3, negative
numbers- 3
2. WACP that displays the famous conjecture by converging the number to 1. The
famous conjecture states that given any number if the following rules are
REPEATEDLY applied the number eventually converges to one.
If even: Divide the number by two
If Odd: Multiply number by 3 and add one to it.
3. WACP that prints the following pattern
*
***
*****
*******
Functions(3)
1. WACP using functions that uses a function to find the sum of the series 1+1/4 + 1/9 +
1/16+…… upto n.
2. Write a menu-based C program using functions to print i) Fibonacci series between a
given range R1 and R2 ii) prime numbers between a given range R1 and R2 iii) print
perfect numbers between given range R1 and R2. Ensure that R1 >1 and R2 <200
3. WACP using recursion to print the i) gcd of two numbers ii) gcd of three numbers
4. WACP using recursion to print the factorial of a number
5. WACP using recursion to print the Fibonacci series
6. WACP using recursion to implement the tower of Hanoi
7. WACP using recursion to implement binary search.
Arrays(3)
1. WACP that displays the frequency of each element of the array. You must implement
using both the following i) without creating another array ii) create a structure that
will contain two arrays one is the input array and other frequency array
2. WACP that will partition an array in such a way that all the negative numbers are on
the left and positive numbers are on the right side
3. WACP that will input a 2D array. Write a function that will sort the elements of this
matrix i)row -wise ii) column wise
Strings(2)
1. WACP that will delete all the occurrences of a character from a string. Write a
function to implement this, the function should accept two arguments a string and a
character. E.g. input- hafed character- f output- haed
2. WACP in which write a function that deletes all the common characters from the two
strings. It should take two arguments as the two strings. Eg. Input – abcdpqrs,
abcdefgh. Output-pqrs, efgh
Structures (2)
1. WACP to create a structure for a student with details like name, rollno, and marks of
five subjects. The program takes input as details for students. Write a function that
will take the percentage of each student and display grades
a) Percentage > 80 then Grade = A
b) Percentage between 61 & 80 then Grade = B
c) Percentage between 51 & 60 then Grade = C
d) Percentage between 41 & 50 then Grade = D
e) Percentage between 35 & 40 then Grade = E
f) Percentage < 35 then Grade = F

Read the input from a file(input.txt) and display the details (Name, Age, Percentage
and Grades) in an output file(output.txt)
Files (2)
1. WACP to Read a text file abc.txt and count the number of sentences, number of
words and number of characters in it (including special characters and spaces). A
sentence can be terminated by (.), (!), or (?). A word is separated by spaces except the
first and last word of a sentence which either begins with a terminator ((.), (!), or (?))
or ends with it
2. WAP to read a text file info.txt and encode it using all the following rules into a new
file secret.txt
a) Each alphabet is replaced by its next alphabet in sequence
b) Each space to be replaced by $ sign
c)All numeric digits and special chars must remain unchanged

You might also like