Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

List of the programs for practice in C Arrays Problem 1: There are 20-20 students in each class VII and

VIII. Write a program to read the marks of all the students, calculate 1. The average marks of each class. 2. Highest and lowest marks of individual class. 3. Overall average of all the students. Problem 2: Write a program which reads a text and counts how many times each different letter is repeated. Problem 3: Write a program which reads some numbers and then ask the user which number is required, then it searches its location and frequency of repetition. Problem 4: Write a program which reads some number and then arrange them in ascending and descending order. Problem 5: Write a program that asks the user to type an integer N and compute u(N) defined with : u(0)=1 u(1)=1 u(n+1)=u(n)+u(n-1) Problem 6: Write a program that ask the user to type 10 integers and write the number of occurrence of the biggest value. Problem 7: The country A has 50M inhabitants and its population grows 3% a year, the country B, 70M and grows 2% a year. tell in how many years will A surpass B. Problem 8: Write a menu driven program which asks the user choice as : What do you want to do : 1. Add 2. Multiply 3. Division 4. Subtraction 5. Exit

Now if user says 1 : It goes to new screen.. Screen title becomes Addition : And now it asks two numbers and shows the results (number 1 + number 2) The user sees the results and presses any key.. It goes back to Menu. Shows menu and continues from there.. It goes on and on and on till user says, 5 : Exit. Problem 9: Read n from user and find out the sum of the series.

Problem 10: Write a program to produce n times multiplication table ( less than or equal to 10). For example, n=4 1 2 3 4 1 1 2 3 4 2 2 4 6 8 3 3 6 9 12 4 4 8 12 16 Convert your algorithm into a program. Use nested for loops and pay attention to formatting your output so that it is displayed neatly. Problem 11: Write a function that outputs a right isosceles triangle of height and width n, so n = 6 would look like * ** *** **** ***** ****** Problem 12: Read lots of numbers from user (Till user enters -1) Find out the maximum number out of all numbers .. Lets say input is.. 3,23,345,21,343,2,43,55,333,233,22,444,-1 .. So answer should be : 444

You might also like