Friday, March 28, 2014

Program to calculate the product of odd integers from 1 to 15 using for loop.

#include<stdio.h>
#include<stdlib.h>
void line()
{
int i,j;
printf("\n");
for(i=1;i<=42;i++)
printf("=");
}
void header()
{
printf("\n");
printf("Built and Designed by Arslan Malik\n\n www.CworldbyAS.blogspot.com");
printf("\n");
}
int main()
{
line();
header();
line();

int a,product=1;
for(a=1;a<=15;a+=2)
product*=a;
printf("\nYour product is  : %d",product);


return 0;
}

No comments:

Post a Comment