Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
494 B
5
Indexable
Never
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
struct Produs
{
	int cod;
	char nume[15];
	int cantitate;
	float pret;
};

void main()
{
	struct Produs x[20];
	int i = 0;
	printf("cod = ");
	scanf("%i", &x[i].cod);
	while (!feof(stdin))
	{
		printf("nume = ");
		getchar();
		gets(x[i].nume);

		printf("cantitate = ");
		scanf("%i", &x[i].cantitate);

		printf("pret = ");
		scanf("%f", &x[i].pret);

		i++;
		printf("cod = ");
		scanf("%i", &x[i].cod);
	}
}
Leave a Comment