Guest User

Untitled

a guest
Jan 21st, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. while (fscanf(fptr, "%c", &Country) != EOF){
  2.  
  3. fscanf(fptr, "%s", &Country);
  4. fscanf(fptr, "%f", &fPop);
  5. fscanf(fptr, "%f", &fMas);
  6. fscanf(fptr, "%f", &dGDP);
  7.  
  8. fGDPCap = ((dGDP*1000000)/fPop);
  9.  
  10. fPopDen = (fPop/fMas);
  11.  
  12. printf("Country: %s\n", Country);
  13. printf("Population:......%1.0f\n", fPop);
  14. printf("Land Mass:.............%1.0f Km^2\n", fMas);
  15. printf("GDP in millions:...................$%1.2f\n", dGDP);
  16. printf("GDP per head:.............................$%1.2f\n", fGDPCap);
  17. printf("Population Density:............................%1.2f People / Km^2\n\n\n", fPopDen);
  18.  
  19.  
  20. }
  21. }
Add Comment
Please, Sign In to add comment