Reginaldojs

exercicio 7,lista 2

Aug 30th, 2012
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.83 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. int main (){
  4.       float n1,n2,n3,n4,n5;
  5.       printf("digite o primeiro numero:");
  6.       scanf("%f",&n1);
  7.       printf("digite o segundo:");
  8.       scanf("%f",&n2);
  9.       printf("gigite o terceiro:");
  10.       scanf("%f",&n3);
  11.       printf("digite o quarto:");
  12.       scanf("%f",&n4);
  13.       printf("digite o quinto:");
  14.       scanf("%f",&n5);
  15.       if (n1<0)
  16.         printf("o primeiro numero= negativo\n");
  17.       if (n2<0)
  18.         printf("segundo numero= negativo\n");
  19.       if (n3<0)
  20.         printf("terceiro numero= negativo\n");
  21.       if (n4<0)
  22.         printf("quarto numero= negativo\n");
  23.       if (n5<0)
  24.         printf("quinto numero= negativo\n");
  25.       if (n1>0 && n2>0 && n3>0 && n4>0 && n5>0)
  26.         printf("todos os numeros sao positivos\n");
  27.       system("pause");
  28.       return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment