Using a for loop, write a program that prints out the decimal equivalents of 1/2, 1/3, 1/4,..., 1/10.
Answers
Answered by
2
# include <iostream.h>
# include <conio.h >
void main()
{
int n,i;
for (i=1;i<=10,i++)
{
n=1/i
cout <<"decimal equivalent is"<<n <<<<"/n";
}
getch ()
}
# include <conio.h >
void main()
{
int n,i;
for (i=1;i<=10,i++)
{
n=1/i
cout <<"decimal equivalent is"<<n <<<<"/n";
}
getch ()
}
Similar questions
India Languages,
8 months ago
Math,
8 months ago
English,
8 months ago
Physics,
1 year ago
English,
1 year ago