Tuesday, April 28, 2015

C PROGRAMMING SHEET 3

Topics Covered:-

     Ø Loop Control Structure (while, for, break, continue,           do-while)

1.     Write a program to calculate overtime pay of 10 employees. Overtime is paid at the rate of Rs 12.00 per hour for every hour worked above 40 hours. Assume that the employees do not work for fractional part of an hour.

2.     WAP to find the factorial value of any number entered through the keyboard.

3.     Two numbers are entered through the keyboard. Write a program to find the value of one number raised to the power of another.

4.     WAP to print all the ASCII values and their equivalent characters using a while loop. The ASCII values vary from 0 to 255.

5.     WAP to print all Armstrong numbers between 1 and 500.If the sum of the cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong number. For example, 153=(1*1*1)+(5*5*5)+(3*3*3)

6.     WAP to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeroes entered.

7.     WAP to add the first seven terms of the following series using a loop:-
1/1! + 2/2! + 3/3! +...

8.     WAP to print the multiplication table of the number entered by the user. The table should get displayed in the following form.
  15*1=15
  15*2=30

9.     Develop a program to check whether the number entered is a Palindrome.

10.            WAP to print the following pattern :-
******
***** 
**** 
*** 
** 
* 

11.                  WAP to print the following pattern:-

       1****** 
       12***** 
       123**** 
       1234*** 
       12345** 
       123456* 
       1234567 

12.            Develop a program to print the Floyd's triangle.
1
2     3
4     5    6
7     8    9    10
11..12   13  14   15
                          79 … … … … … … 91


No comments:

Post a Comment