fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int triNum = 0;
  6. int n;
  7.  
  8. for(n = 5; n <= 50; n = n + 5)
  9. {
  10. triNum = n * (n + 1)/2;
  11. printf (" %d %d\n", n, triNum);
  12. }
  13. return(0);
  14. }
  15.  
Success #stdin #stdout 0.01s 5300KB
stdin
Standard input is empty
stdout
 5 15
 10 55
 15 120
 20 210
 25 325
 30 465
 35 630
 40 820
 45 1035
 50 1275