Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- int
- main (void)
- {
- struct supermercado //Definindo informacoes de Cadastro
- {
- char item[10];
- char marca[20];
- float valor;
- };
- struct supermercado supermercado; // Definindo a variavel
- printf ("\n::::.... Cadastro produtos ....::::\n\n\n");
- //registrando informações
- printf ("Informe o item:");
- fflush (stdin);
- fgets (supermercado.item, 10, stdin);
- printf ("Informe a marca:");
- fflush (stdin);
- fgets (supermercado.marca, 20, stdin);
- printf ("Informe o valor:");
- scanf ("%f", &supermercado.valor);
- //imprimindo informações registradas
- printf ("\n\n --------- informações registradas ---------\n\n");
- printf ("Item ..................: %s\n", supermercado.item);
- printf ("Marca .................: %s\n", supermercado.marca);
- printf ("Valor .................: R$%.2f\n", supermercado.valor);
- getch ();
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement