First Please Subscribe Our Channel Click Here For Subscribe
Close
C PROGRAMMING WORLD
BY SUNIL KUMAR DHEENDHWAL
Pages
INDEX
Home
INSTALING STEPS OF TURBO
How To Start Programming With C
HOW TO EARN MONEY ONLINE
Find Us On Facebook
WAP to find the sum of the reciprocal of a set of integer numbers to be feed from the keyboard . however reciprocal of 0 is not defined and should be ignored...
void main()
{
float i,no,rev,sum;
clrscr();
for(i=1; i<=5;i++)
{
printf("Enter the number");
scanf("%f", &no);
if(no==0)
continue;
else
rev=1/no;
printf("\n%f",rev);
sum=sum+rev;
}
printf("\n\nsum of reciprocal=%f",sum);
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment