seergiomv

ejercicio 8.1

Oct 1st, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.     char n[50];
  5.     float e, c, t, total;
  6.     printf("Nombre: ");
  7.     scanf("%s", &n);
  8.     printf("Edad: ");
  9.     scanf("%f", &e);
  10.     printf("Total gastado en cañas esta semana: ");
  11.     scanf("%f", &c);
  12.     printf("Total gastado en transporte esta semana: ");
  13.     scanf("%f", &t);
  14.     total = c + t;
  15.     printf("Nombre:%s \n", n);
  16.     printf("Edad:%2.f \n", e);
  17.     printf("Gastado en cañas:%.2f \n", c);
  18.     printf("Gastado en transporte:%.2f \n", t);
  19.     printf("Total gastado esta semana: %.2f \n", total);
  20.  
  21. }
Add Comment
Please, Sign In to add comment