diogoAlves

IFF/Introdução à Programação/Lista/96

Mar 8th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. //IFF - Introdução à Programação
  2. //Lista - Exercício 96
  3. #include<stdio.h>
  4. #include<locale.h>
  5.  
  6. char Info(int n){
  7.     char info;
  8.     if(n>0) info='P'; else info='N';
  9.     return info;
  10. }
  11.  
  12. int main(){
  13.     setlocale(LC_ALL,"Portuguese");
  14.     int n;
  15.     printf("Entre com o valor: ");
  16.     scanf("%d",&n);
  17.     printf("O número é %c. (P - Positivo / N - Negativo)",Info(n));
  18. }
Advertisement
Add Comment
Please, Sign In to add comment