renix1

FORMULA DO AMOR, feita em C, KKKKKKKKKKKKKK

Feb 26th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.11 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. #include <conio.h>
  5. #include <ctype.h>
  6.  
  7. int main (void) {
  8.  
  9.  
  10.     //PROTÓTIPO DA FUNÇÃO
  11.     void exibindo_tela(void);
  12.     //INICIANDO FUNÇÃO
  13.     exibindo_tela();
  14.  
  15.     return(0);
  16.  
  17. }
  18.  
  19. void exibindo_tela (void) {
  20.  
  21.     //VARIÁVEIS
  22.     char primeiraPessoa[100];
  23.     char segundaPessoa[100];
  24.     //PROTÓTIPO DA FUNÇÃO
  25.     int semantica_do_amor(void);
  26.  
  27.     printf("\t\t\t\t-- TESTANDO O CASAL -- \n");
  28.     //PRIMEIRA PESSOA
  29.     printf("Digite o seu nome: ");
  30.     scanf("%s", primeiraPessoa);
  31.     //SEGUNDA PESSOA
  32.     printf("Digite o nome dele(a): ");
  33.     scanf("%s", segundaPessoa);
  34.     //CONVERTE PRIMEIRA LETRA PARA MAIUSCULA
  35.     primeiraPessoa[0] = toupper(primeiraPessoa[0]);
  36.     segundaPessoa[0] = toupper(segundaPessoa[0]);
  37.     //EXIBINDO RESULTADO
  38.     printf("O amor entre %s e %s tem uma porcentagem equivalente a: %03d%% de amor\n", primeiraPessoa, segundaPessoa, semantica_do_amor());
  39.  
  40. }
  41.  
  42. int semantica_do_amor (void) {
  43.     srand((unsigned)time(NULL));
  44.     short int love = 10 + ( rand() % 100);
  45.     if (love > 100)
  46.         love=100;
  47.     return(love);
  48. }
Advertisement
Add Comment
Please, Sign In to add comment