Problemas para ingresar en un IF
Publicado por Ruddy Catalan (1 intervención) el 04/09/2006 03:11:12
tengo algunos problemas para que una rutina entre a un IF,
el problema en concreto es en:
if (cant_may<=cantidad)
{
cant_may=cantidad;
art_may=nombre;
}
y en:
while (cont<term)
{
sera error de sintaxis????? es que soy nuevo :p
aca esta el codigo completo
#include <stdio.h>
#include <conio.h>
int desc, iva, valor_art, cantidad, total_venta, total_desc, totcon_iva, cant_art,cant_may, cont, term, opcion;
char nombre, art_may;
main(void)
{
clrscr();
printf ("Ingresar Producto? 1/n ");
scanf ("%i",opcion);
cont=0;
if (opcion=1)
{
printf ("Cantidad de compras? ");
scanf ("%i",term);
cant_may=0;
while (cont<term)
{
printf ("Ingrese nombre del producto ");
scanf ("%d",nombre);
printf ("Ingrese el valor de producto ");
scanf ("%i",valor_art);
printf ("Cantidad de productos? ");
scanf ("%i",cantidad);
if (cant_may<=cantidad)
{
cant_may=cantidad;
art_may=nombre;
}
else
{
}
total_venta=total_venta+(valor_art*cantidad);
cont=cont+1;
}
printf ("Valor del descuento ");
scanf ("%i",desc);
printf ("Valor de IVA ");
scanf ("%i",iva);
gotoxy (5,12);
printf ("Total Neto: %d \n",total_venta);
total_desc=total_venta-(total_venta-((total_venta*desc)/100));
gotoxy (5,13);
printf ("Total descuento: %d \n ",total_desc);
totcon_iva=total_venta-total_desc;
totcon_iva=(totcon_iva*iva)/100;
gotoxy (5,14);
printf ("Total de Compra %d \n",totcon_iva);
scanf ("%i",cont);
}
return 0;
}
gracias por la ayuda, salu2
el problema en concreto es en:
if (cant_may<=cantidad)
{
cant_may=cantidad;
art_may=nombre;
}
y en:
while (cont<term)
{
sera error de sintaxis????? es que soy nuevo :p
aca esta el codigo completo
#include <stdio.h>
#include <conio.h>
int desc, iva, valor_art, cantidad, total_venta, total_desc, totcon_iva, cant_art,cant_may, cont, term, opcion;
char nombre, art_may;
main(void)
{
clrscr();
printf ("Ingresar Producto? 1/n ");
scanf ("%i",opcion);
cont=0;
if (opcion=1)
{
printf ("Cantidad de compras? ");
scanf ("%i",term);
cant_may=0;
while (cont<term)
{
printf ("Ingrese nombre del producto ");
scanf ("%d",nombre);
printf ("Ingrese el valor de producto ");
scanf ("%i",valor_art);
printf ("Cantidad de productos? ");
scanf ("%i",cantidad);
if (cant_may<=cantidad)
{
cant_may=cantidad;
art_may=nombre;
}
else
{
}
total_venta=total_venta+(valor_art*cantidad);
cont=cont+1;
}
printf ("Valor del descuento ");
scanf ("%i",desc);
printf ("Valor de IVA ");
scanf ("%i",iva);
gotoxy (5,12);
printf ("Total Neto: %d \n",total_venta);
total_desc=total_venta-(total_venta-((total_venta*desc)/100));
gotoxy (5,13);
printf ("Total descuento: %d \n ",total_desc);
totcon_iva=total_venta-total_desc;
totcon_iva=(totcon_iva*iva)/100;
gotoxy (5,14);
printf ("Total de Compra %d \n",totcon_iva);
scanf ("%i",cont);
}
return 0;
}
gracias por la ayuda, salu2
Valora esta pregunta


0