fork download
  1. // Online C compiler to run C program online
  2. #include <stdio.h>
  3.  
  4. int main() {
  5. int i = 36666666;
  6. int k = 36666666;
  7. int m;
  8. int n= 1600000;
  9. // Write C code here
  10. for(int l=1;l<60;l++)
  11. {
  12. m =i*0.0805;
  13.  
  14. m=(m-1500000)*0.686+1500000-145600;
  15. i = i+m-n;
  16. k=k*1.06;
  17. n= n*1.06;
  18.  
  19. printf("\nafter year %d,value of 3.66cr should have been %d but actually is%d",l,k,i);
  20.  
  21. }
  22.  
  23.  
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
after year 1,value of 3.66cr should have been 38866665 but actually is37416908
after year 2,value of 3.66cr should have been 41198664 but actually is38112581
after year 3,value of 3.66cr should have been 43670583 but actually is38744911
after year 4,value of 3.66cr should have been 46290817 but actually is39304295
after year 5,value of 3.66cr should have been 49068266 but actually is39780233
after year 6,value of 3.66cr should have been 52012361 but actually is40161257
after year 7,value of 3.66cr should have been 55133102 but actually is40434853
after year 8,value of 3.66cr should have been 58441088 but actually is40587381
after year 9,value of 3.66cr should have been 61947553 but actually is40603984
after year 10,value of 3.66cr should have been 65664406 but actually is40468495
after year 11,value of 3.66cr should have been 69604270 but actually is40163335
after year 12,value of 3.66cr should have been 73780526 but actually is39669402
after year 13,value of 3.66cr should have been 78207357 but actually is38965956
after year 14,value of 3.66cr should have been 82899798 but actually is38030494
after year 15,value of 3.66cr should have been 87873785 but actually is36838613
after year 16,value of 3.66cr should have been 93146212 but actually is35363867
after year 17,value of 3.66cr should have been 98734984 but actually is33577612
after year 18,value of 3.66cr should have been 104659083 but actually is31448841
after year 19,value of 3.66cr should have been 110938627 but actually is28944008
after year 20,value of 3.66cr should have been 117594944 but actually is26026836
after year 21,value of 3.66cr should have been 124650640 but actually is22658113
after year 22,value of 3.66cr should have been 132129678 but actually is18795475
after year 23,value of 3.66cr should have been 140057458 but actually is14393174
after year 24,value of 3.66cr should have been 148460905 but actually is9401826
after year 25,value of 3.66cr should have been 157368559 but actually is3768147
after year 26,value of 3.66cr should have been 166810672 but actually is-2565337
after year 27,value of 3.66cr should have been 176819312 but actually is-9660592
after year 28,value of 3.66cr should have been 187428470 but actually is-17584406
after year 29,value of 3.66cr should have been 198674178 but actually is-26408740
after year 30,value of 3.66cr should have been 210594628 but actually is-36211100
after year 31,value of 3.66cr should have been 223230305 but actually is-47074939
after year 32,value of 3.66cr should have been 236624123 but actually is-59090084
after year 33,value of 3.66cr should have been 250821570 but actually is-72353197
after year 34,value of 3.66cr should have been 265870864 but actually is-86968261
after year 35,value of 3.66cr should have been 281823115 but actually is-103047107
after year 36,value of 3.66cr should have been 298732501 but actually is-120709970
after year 37,value of 3.66cr should have been 316656451 but actually is-140086090
after year 38,value of 3.66cr should have been 335655838 but actually is-161314350
after year 39,value of 3.66cr should have been 355795188 but actually is-184543960
after year 40,value of 3.66cr should have been 377142899 but actually is-209935182
after year 41,value of 3.66cr should have been 399771472 but actually is-237660117
after year 42,value of 3.66cr should have been 423757760 but actually is-267903531
after year 43,value of 3.66cr should have been 449183225 but actually is-300863747
after year 44,value of 3.66cr should have been 476134218 but actually is-336753595
after year 45,value of 3.66cr should have been 504702271 but actually is-375801427
after year 46,value of 3.66cr should have been 534984407 but actually is-418252198
after year 47,value of 3.66cr should have been 567083471 but actually is-464368625
after year 48,value of 3.66cr should have been 601108479 but actually is-514432421
after year 49,value of 3.66cr should have been 637174987 but actually is-568745611
after year 50,value of 3.66cr should have been 675405486 but actually is-627631944
after year 51,value of 3.66cr should have been 715929815 but actually is-691438390
after year 52,value of 3.66cr should have been 758885603 but actually is-760536746
after year 53,value of 3.66cr should have been 804418739 but actually is-835325348
after year 54,value of 3.66cr should have been 852683863 but actually is-916230893
after year 55,value of 3.66cr should have been 903844894 but actually is-1003710390
after year 56,value of 3.66cr should have been 958075587 but actually is-1098253240
after year 57,value of 3.66cr should have been 1015560122 but actually is-1200383451
after year 58,value of 3.66cr should have been 1076493729 but actually is-1310662004
after year 59,value of 3.66cr should have been 1141083352 but actually is-1429689380