Reginaldojs

exercicio 25,lista 3

Aug 21st, 2012
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2. #include<stdlib.h>
  3. #include <math.h>
  4. int main (){
  5.     float grao,quilos,i;
  6.     printf("Vamos fazer a contagem dos graos:\n\n");
  7.     for (i=0;i<64;i++){
  8.         grao=grao+(pow(2,i));
  9.     }
  10.     quilos=grao/50000;/*Estimei 50000 como sendo a quantidade de graos*/
  11.     printf("Temos %.0f graos de arroz e\n\n",grao);
  12.     printf("Temos,portanto,%.0f sacos de arroz de 5kg cada\n\n",quilos);
  13.     system("pause");
  14.     return(0);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment