fork download
  1. // Online C compiler to run C program online
  2. #include <stdio.h>
  3.  
  4. int main() {
  5. int i = 26666666;
  6. int k = 26666666;
  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 2.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 5280KB
stdin
Standard input is empty
stdout
after year 1,value of 2.66cr should have been 28266665 but actually is26864678
after year 2,value of 2.66cr should have been 29962664 but actually is26977625
after year 3,value of 2.66cr should have been 31760423 but actually is26995049
after year 4,value of 2.66cr should have been 33666048 but actually is26905571
after year 5,value of 2.66cr should have been 35686010 but actually is26696815
after year 6,value of 2.66cr should have been 37827170 but actually is26355333
after year 7,value of 2.66cr should have been 40096800 but actually is25866525
after year 8,value of 2.66cr should have been 42502608 but actually is25214546
after year 9,value of 2.66cr should have been 45052764 but actually is24382215
after year 10,value of 2.66cr should have been 47755929 but actually is23350911
after year 11,value of 2.66cr should have been 50621284 but actually is22100467
after year 12,value of 2.66cr should have been 53658561 but actually is20609048
after year 13,value of 2.66cr should have been 56878074 but actually is18853033
after year 14,value of 2.66cr should have been 60290758 but actually is16806875
after year 15,value of 2.66cr should have been 63908203 but actually is14442962
after year 16,value of 2.66cr should have been 67742695 but actually is11731461
after year 17,value of 2.66cr should have been 71807256 but actually is8640154
after year 18,value of 2.66cr should have been 76115691 but actually is5134262
after year 19,value of 2.66cr should have been 80682632 but actually is1176260
after year 20,value of 2.66cr should have been 85523589 but actually is-3274331
after year 21,value of 2.66cr should have been 90655004 but actually is-8261151
after year 22,value of 2.66cr should have been 96094304 but actually is-13831242
after year 23,value of 2.66cr should have been 101859962 but actually is-20035287
after year 24,value of 2.66cr should have been 107971559 but actually is-26927876
after year 25,value of 2.66cr should have been 114449852 but actually is-34567789
after year 26,value of 2.66cr should have been 121316843 but actually is-43018297
after year 27,value of 2.66cr should have been 128595853 but actually is-52347484
after year 28,value of 2.66cr should have been 136311604 but actually is-62628596
after year 29,value of 2.66cr should have been 144490300 but actually is-73940405
after year 30,value of 2.66cr should have been 153159718 but actually is-86367606
after year 31,value of 2.66cr should have been 162349301 but actually is-100001238
after year 32,value of 2.66cr should have been 172090259 but actually is-114939132
after year 33,value of 2.66cr should have been 182415674 but actually is-131286397
after year 34,value of 2.66cr should have been 193360614 but actually is-149155929
after year 35,value of 2.66cr should have been 204962250 but actually is-168668964
after year 36,value of 2.66cr should have been 217259985 but actually is-189955662
after year 37,value of 2.66cr should have been 230295584 but actually is-213155736
after year 38,value of 2.66cr should have been 244113319 but actually is-238419121
after year 39,value of 2.66cr should have been 258760118 but actually is-265906687
after year 40,value of 2.66cr should have been 274285725 but actually is-295791003
after year 41,value of 2.66cr should have been 290742868 but actually is-328257154
after year 42,value of 2.66cr should have been 308187440 but actually is-363503608
after year 43,value of 2.66cr should have been 326678686 but actually is-401743147
after year 44,value of 2.66cr should have been 346279407 but actually is-443203858
after year 45,value of 2.66cr should have been 367056171 but actually is-488130193
after year 46,value of 2.66cr should have been 389079541 but actually is-536784096
after year 47,value of 2.66cr should have been 412424313 but actually is-589446210
after year 48,value of 2.66cr should have been 437169771 but actually is-646417165
after year 49,value of 2.66cr should have been 463399957 but actually is-708018949
after year 50,value of 2.66cr should have been 491203954 but actually is-774596374
after year 51,value of 2.66cr should have been 520676191 but actually is-846518637
after year 52,value of 2.66cr should have been 551916762 but actually is-924180990
after year 53,value of 2.66cr should have been 585031767 but actually is-1008006518
after year 54,value of 2.66cr should have been 620133673 but actually is-1098448035
after year 55,value of 2.66cr should have been 657341693 but actually is-1195990110
after year 56,value of 2.66cr should have been 696782194 but actually is-1301151223
after year 57,value of 2.66cr should have been 738589125 but actually is-1414486069
after year 58,value of 2.66cr should have been 782904472 but actually is-1536588011
after year 59,value of 2.66cr should have been 829878740 but actually is-1668091699