#include <math.h>
main()
{
double x, y;
int count;
count = 1;
printf("Enter FIVE real values in a LINE \n");
read:
scanf("%lf", &x);
printf("\n");
if (x < 0)
printf("Value - %d is negative\n",count);
else
{
y = sqrt(x);
printf("%lf\t %lf\n", x, y);
}
count = count + 1;
if (count <= 5)
goto read;
printf("\nEnd of computation");
}
Output
Enter FIVE real values in a LINE
50.70 40 -36 75 11.25
50.750000 7.123903
40.000000 6.324555
Value -3 is negative
75.000000 8.660254
11.250000 3.354102
End of computation