nak mintak tolong betulkan c code aku..
nak mintak tolong sesape tolong ringkaskan code aku nie..void Calculate()
{
for (int i=0;i<1;i++)
{
for(int j=0;j<3;j++)
{
c = x * w;
sum1 += c;
printf("Output[%d]: %.1f ",i+1,c);
}
printf("\n");
printf("Sum: %.1f\n",sum1);
}
printf("\n");
for (int i=1;i<2;i++)
{
for(int j=0;j<3;j++)
{
c = x * w;
sum2 += c;
printf("Output[%d]: %.1f ",i+1,c);
}
printf("\n");
printf("Sum: %.1f\n",sum2);
}
printf("\n");
for (int i=2;i<3;i++)
{
for(int j=0;j<3;j++)
{
c = x * w;
sum3 += c;
printf("Output[%d]: %.1f ",i+1,c);
}
printf("\n");
printf("Sum: %.1f\n",sum3);
}
printf("\n");
for (int i=3;i<4;i++)
{
for(int j=0;j<3;j++)
{
c = x * w;
sum4 += c;
printf("Output[%d]: %.1f ",i+1,c);
}
printf("\n");
printf("Sum: %.1f\n",sum4);
}
printf("\n");
}
aku nak display sum of the row.. sum1 sum first row je.. sum2 sum second row je.. and so on.. camne nak bagi ringkaskan code tu ek?? aku nie tak terer programming tu code repeat je.. hehe.. tolong ek sesape.. thanx..
int n =your limit loop
for ( int c =0;c<n;c++) {
for (int i=c-1;c<1;i++) {
{
for(int j=0;j<3;j++)
{
c = x * w;
sum1 += c;
printf("Output[%d]: %.1f ",i+1,c);
}
printf("\n");
printf("Sum: %.1f\n",sum1);
}
}
}
{:3_100:} 2# alien3d
wah.. sejak bile forum ade function nie?? da lame tak masuk forum da ubah banyak da.. anyway thanx for the code.. 3# DaoMing_Si
tu ah! Nice! camne ek?
Pages:
[1]