Advertisement
FAMDS

Agenda

Nov 13th, 2022
773
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.08 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3. int
  4. main (void)
  5. {
  6.  
  7.   struct agenda         //Definindo informacoes de Cadastro
  8.   {
  9.     char nome[50];
  10.     char telefone[20];
  11.     char endereco[50];
  12.     char email[50];
  13.   };
  14.   struct agenda agenda;     // Definindo a variavel
  15.  
  16.   printf ("\n::::.... Agenda ....::::\n\n\n");
  17. //registrando informações
  18.   printf ("Informe o nome:");
  19.   fflush (stdin);
  20.   fgets (agenda.nome, 50, stdin);
  21.  
  22.   printf ("Informe o telefone:");
  23.   fflush (stdin);
  24.   fgets (agenda.telefone, 20, stdin);
  25.  
  26.   printf ("Informe o endereco:");
  27.   fflush (stdin);
  28.   fgets (agenda.endereco, 50, stdin);
  29.  
  30.   printf ("Informe o email:");
  31.   fflush (stdin);
  32.   fgets (agenda.email, 50, stdin);
  33.  
  34. //imprimindo informações registradas
  35.   printf ("\n\n --------- informações registradas ---------\n\n");
  36.   printf ("Nome .....................: %s\n", agenda.nome);
  37.   printf ("Telefone .................: %s\n", agenda.telefone);
  38.   printf ("Endereco .................: %s\n", agenda.endereco);
  39.   printf ("Email ....................: %s\n", agenda.email);
  40.   getch ();
  41.   return (0);
  42. }
  43.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement