Está en la página 1de 1

//Note:The template file will be copied to a new file.

When you change the code of


the template file you can create new file with this base code.
#include <stdio.h>
int main()
{
char P[5][30];
int C[5];
float Pr[5],Im[5],i;
for (i=1; i<=2; i=i+1)
{
printf("Escribe el nombre del producto para: P[i]\n",i);
scanf ("%s", &P[i]);
printf("Escribe la cantidad del producto para: \n", C[i]);
scanf ("%d", &C[i]);
printf("Escribe el precio del producto: \n", Pr[i]);
scanf ("%f", &Pr[i]);
Im[i]= C[i]*Pr[i];
}
printf ("N.1 producto cantidad precio importe \n");
for (i=1; i<=2; i=i+1);
{
printf ("%d. %s. %d. %.1f. %.1f. \n",i, P[i],C[i],Pr[i],Im[i]);
}
return(0);
}

También podría gustarte