fork download
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int i, t;
  6. t=0;
  7. printf("Enter total months due: ");
  8. scanf("%d",&i);
  9. for(i=i-2;i>0 ;i-- )
  10. {
  11. t = t + i * 100;
  12. }
  13. printf("Total penalty due: %d",t);
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 5264KB
stdin
Standard input is empty
stdout
Enter total months due: Total penalty due: 2129462748