Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include<time.h>
  4. #include<math.h>
  5. void main() {
  6. srand(time(NULL));
  7. printf("Radius\tCircle Area\n");
  8. printf("--------------------\n");
  9. int rad[7];
  10. float area[7];
  11. for (int i = 0; i < 7;i++) {
  12. rad[i] = rand() % (12 + 1 - 2) + 2;
  13. }
  14. for (int i = 0; i < 7;i++) {
  15. area[i] = 2*3.14*rad[i]*rad[i];
  16. }
  17. for (int i = 0; i < 7; i++) {
  18. printf("%d\t%.2f\n",rad[i],area[i]);
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement