Need some help for a c problem

Discussion in 'C' started by dany12, Aug 28, 2010.

  1. dany12

    dany12 New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    First of all I want to thank the guys form this forum for there work and help that I found more then use full an different occasions.
    Here is my c programing exercise.
    Write a c program that shows all the products tahat have the price over 10.
    Any help would be apreciated
    This is how I thought I could make the program
    Code:
    int nr_products;//initialization
    int nr_prices;
    char products;
    int price;
    int main()
    {
            
    
    nr_products=nr_prices;
    if(nr_products=2)
    printf("No products");
    scanf("%d",&nr_products);
    printf("Products:");//enter the products
    scanf("%c",products);
    printf("Price:");//enter price
    scanf("%d",&price);
            if(price>10)//condition over 10
            {
                    printf("Products that have the price over 10 are",products);//products over 10
    
            }        
    else printf("Eroare");//not found nay products over 10
    getch();
    }
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice