fork download
  1. // Lab 8, Working with structs
  2. // Programmer : Maiar Khattab
  3. // Editor(s) used : Code Blocks 13.12
  4. // Compiler(s) used : Code Blocks 13.12
  5.  
  6. #include<iostream>
  7. using std::cout;
  8. using std::endl;
  9.  
  10. #include<cstdlib>
  11.  
  12.  
  13. //void printTod(const tod&);
  14. int main ()
  15. {
  16. double pr;
  17. for (int i=1;i<=21;i++){
  18. pr =i;
  19. cout << i << "\t"<< pr/21*100<<endl;
  20. }}
  21.  
  22.  
Success #stdin #stdout 0.01s 5280KB
stdin
 
stdout
1	4.7619
2	9.52381
3	14.2857
4	19.0476
5	23.8095
6	28.5714
7	33.3333
8	38.0952
9	42.8571
10	47.619
11	52.381
12	57.1429
13	61.9048
14	66.6667
15	71.4286
16	76.1905
17	80.9524
18	85.7143
19	90.4762
20	95.2381
21	100