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!
The errors I am getting via codepad: http://codepad.org/hs8IbtAICode:#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 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