blob: a64c4c9e41f3d4290637d36454482ceb11959d68 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// Example 5.7
// The program evaluates the square root for five numbers.
count=1;
printf("Enter FIVE real values\n");
while(count<=5)
x=scanf("%f");
if(x<0) then
printf("Value - %d is negative\n",count);
else
y=sqrt(x); //Calculate square root
printf("%f\t%f\n",x,y); //Print result
end
count=count+1;
end
printf("End of computation");
|