Drowze

03 Comando Condicional de Selecao 04

Mar 29th, 2014
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. /* Fazer um programa que receba três números e imprima apenas os menores que 3. */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main()
  6. {
  7.     int a,b,c;
  8.  
  9.     printf("Digite tres numeros e exibirei os numeros menores que 3: ");
  10.     scanf("%d %d %d", &a,&b,&c);
  11.  
  12.     printf("Os menores que 3 sao: ");
  13.     if(a<3) printf("%d ",a);
  14.     if(b<3) printf("%d ",b);
  15.     if(c<3) printf("%d\n",c);
  16.  
  17.     system("pause");
  18. }
Advertisement
Add Comment
Please, Sign In to add comment