Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Thursday, January 21, 2010

Write a program in c using the do while loop calculate and print the product ( p = 1 * 2 * 3 * 4 * 5 * 6 * 7 )



#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
int i, p;
p = 1;
i = 1;
do
{
p = p * i;
i = i + 1;
}
while ( i < 8);
printf("The product is %d\n", p);
return(0);
}

Output:-
The product is 5040

Related Posts by Categories



0 comments:

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP