Thread: What is it I'm forgetting!?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2012
    Posts
    21

    What is it I'm forgetting!?

    I've been sitting here wondering what it is I'm forgetting and why it is NOT compiling for more than an hour, I've done it via pico and codepad

    Can someone please help!

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    main()
    
    //HW2
    
    {
    int n=0;
    int m=0;
    int a=0;
    
            printf("Enter the amount of Adults:\n");
    
            scanf("%d", &n);
    
    
        if (n>2 || n<2) {
            printf("Error! you are required to input 2 adults\n");
        exit(1);
        }
    
            printf("Enter the amount of Children:\n");
    
            scanf("%d", &m);
    
    
        if (m>1 || m<1) {
            printf("Error! you are required to input 1 child\n");
        exit(1);
        }
    
            printf("How old is your child?:\n");
    
            scanf("%d", &a);
    
        if (a=<6)
        printf("Your child may enter the park for free.\n");
            else if (a => 7 || a =< 12)
        printf("Your child will get 10% off\n");
            else if (a > 12)
        printf("You do not have a child and they must pay the adult free.\n");
    The errors I am getting via codepad: http://codepad.org/hs8IbtAI

    The errors via pico

    Code:
    hw2.c: In function 'main':
    hw2.c:37: error: expected expression before '<' token
    hw2.c:39: error: expected expression before '>' token
    hw2.c:42: error: expected declaration or statement at end of input
    Last edited by iamtazb; 05-25-2012 at 11:15 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 02-21-2005, 06:11 PM