#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,n,tot=1;
printf("Enter any limit :-");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(i%2 != 0)
{
tot=tot*i;
}
}
printf("Product is %d",tot);
getch();
}
#include<conio.h>
void main()
{
clrscr();
int i,n,tot=1;
printf("Enter any limit :-");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(i%2 != 0)
{
tot=tot*i;
}
}
printf("Product is %d",tot);
getch();
}
No comments:
Post a Comment