Originally Posted by
Adak
No, you need to give your numbers a total width of field:
Code:
printf("%6.2f ",total);
Now the numbers won't be running together one column to the next. Adjust the six as needed, but keep the space after the f.
Thank you so much Mr.Adak. Now the programming is running. Thank You.
Code:
#include<stdio.h>
main()
{
float i,j,total;
float a=0,b=10,c=20,d=30,e=40,f=50;
printf("%12.2f ",a);
printf("%6.2f ",b);
printf("%6.2f ",c);
printf("%6.2f ",d);
printf("%6.2f ",e);
printf("%6.2f ",f);
for(i=100;i<=1000;i=i+200)
{
printf("\n\n");
printf("%6.2f" , i);
for(j=0;j<=50;j=j+10)
{
total = j/i;
printf("%6.2f ",total);
}
}
getch();
}