Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <conio.h>
- #include <ctype.h>
- int main (void) {
- //PROTÓTIPO DA FUNÇÃO
- void exibindo_tela(void);
- //INICIANDO FUNÇÃO
- exibindo_tela();
- return(0);
- }
- void exibindo_tela (void) {
- //VARIÁVEIS
- char primeiraPessoa[100];
- char segundaPessoa[100];
- //PROTÓTIPO DA FUNÇÃO
- int semantica_do_amor(void);
- printf("\t\t\t\t-- TESTANDO O CASAL -- \n");
- //PRIMEIRA PESSOA
- printf("Digite o seu nome: ");
- scanf("%s", primeiraPessoa);
- //SEGUNDA PESSOA
- printf("Digite o nome dele(a): ");
- scanf("%s", segundaPessoa);
- //CONVERTE PRIMEIRA LETRA PARA MAIUSCULA
- primeiraPessoa[0] = toupper(primeiraPessoa[0]);
- segundaPessoa[0] = toupper(segundaPessoa[0]);
- //EXIBINDO RESULTADO
- printf("O amor entre %s e %s tem uma porcentagem equivalente a: %03d%% de amor\n", primeiraPessoa, segundaPessoa, semantica_do_amor());
- }
- int semantica_do_amor (void) {
- srand((unsigned)time(NULL));
- short int love = 10 + ( rand() % 100);
- if (love > 100)
- love=100;
- return(love);
- }
Advertisement
Add Comment
Please, Sign In to add comment