Programação em c struct
#include
#include
#include
#include struct vendedor { char nome[50]; char end; int codigo; int fone;
};
struct produto { char desc[50]; char cod; int un; int forn; char data[50]; int preco;
};
struct cliente { char nome[50]; char cod; int end; int limite; int fone;
};
main () { struct vendedor vend[100]; struct produto prod[100]; struct cliente cli[100]; void consultar(struct cliente[]);
int op=0, aux=1; while(op!=4){ printf("\n\n\t\t\t\t** CADASTRO EMPRESA **\n\n\nMENU\n\n1 - Cadastrar Vendedor\n2 - Cadastrar Produto\n3 - Cadastrar Cliente\n4 - Consultar Cliente\n5 - Consultar Produto\n6 - Registro de Vendas\n7 - Excluir\n8 - Sair\n\nDigite a Opcao Desejada: "); scanf("%d",&op); fflush(stdin); switch(op) { case 1: { // CADASTRAR VENDEDOR int i = 0;
system("cls"); printf("\n\t\tCADASTRO DO VENDEDOR\n"); printf("\nDigite o Nome do Vendedor\n"); scanf("%s", &vend[ i ].nome); printf("\nDigite o Endereco do Vendedor\n"); scanf("%s", &vend[ i ].end); printf("\nDigite o Telefone do Vendedor\n"); scanf("%s", &vend[ i ].fone); printf("\nDigite o Codigo do Vendedor\n"); scanf("%s", &vend[ i ].codigo); printf("\nCadastro Realizado com Sucesso!\n\n"); break; }
case 2: { // CADASTRO DO PRODUTO
int i = 0; system("cls"); printf("\n\t\tCADASTRO DO PRODUTO\n"); printf("\nDigite a Descricao do Produto\n"); scanf("%s", &prod[ i ].desc); printf("\nDigite o Codigo do Produto\n"); scanf("%s", &prod[ i ].cod); printf("\nDigite as Unidades do Produto\n"); scanf("%s", &prod[ i ].un); printf("\nDigite o Fornecedor do Produto\n"); scanf("%s", &prod[ i ].forn); printf("\nDigite a Data da Compra do Produto\n"); scanf("%s", &prod[ i ].data); printf("\nDigite o Preco de Venda do Produto\n"); scanf("%s", &prod[ i ].preco); printf("\nCadastro Realizado com Sucesso!\n\n"); break; } case 3: { // CADASTRO DO CLIENTE
int i = 0;
system("cls");