Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (fscanf(fptr, "%c", &Country) != EOF){
- fscanf(fptr, "%s", &Country);
- fscanf(fptr, "%f", &fPop);
- fscanf(fptr, "%f", &fMas);
- fscanf(fptr, "%f", &dGDP);
- fGDPCap = ((dGDP*1000000)/fPop);
- fPopDen = (fPop/fMas);
- printf("Country: %s\n", Country);
- printf("Population:......%1.0f\n", fPop);
- printf("Land Mass:.............%1.0f Km^2\n", fMas);
- printf("GDP in millions:...................$%1.2f\n", dGDP);
- printf("GDP per head:.............................$%1.2f\n", fGDPCap);
- printf("Population Density:............................%1.2f People / Km^2\n\n\n", fPopDen);
- }
- }
Add Comment
Please, Sign In to add comment