Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- float total = 300.0f;
- float val = 30.0f;
- float percentage = val / total * 100.0f;
- printf("%.2f%%\n", percentage);
- printf("%% %% %%%%\n");
- return 0;
- }
- /*
- output:
- 10.00%
- % % %%
- */
Advertisement
Add Comment
Please, Sign In to add comment