You are on page 1of 1

K. K. Wagh Polytechnic, Nashik – 3.

Subject: Programming in ‘C’ Sub Code: 9017


Class: FYIF (IF/2/C)
Academic Year: 2008 – 2009

Practical No. 6
Understand loop control statements:

1. Write a program to print following output using for loop:


*
* *
* * *
* * * *
2. Accept a number from user and print it in reverse order using do-while loop.
3. Write a program to find sum of all even numbers from n to m. Accept values of
variables n and m from keyboard.
4. Generate the following Fibonacci series using while loop till ‘n’ number. Accept n
from user.
0 1 1 2 3 5 8 13 … … … n
5. Find the addition of all the numbers from n to –n. Take value of n as input from
keyboard. Use for loop.
6. Using while loop, write a program to print all Armstrong numbers between 1 and 500.
If sum of cubes of each digit of the numbers is equal to the number itself, then number
is called Armstrong number. For example: 153 = (1*1*1) + (5*5*5) + (3*3*3)

Kute T. B.
(Subject Teacher)

CPR – Practical No. 6

You might also like