Thread: help im an idiot

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    6

    help im an idiot

    please help me. this is my first day learning about programming and im stuck on lesson 2 of the online tuturial on this website. i havent done any courses or read any books yet. but when i go to do the example programme and compile it comes up with this error: [Warning] In function `int main()':
    `cout' undeclared (first use this function)
    (Each undeclared identifier is reported only
    `cin' undeclared (first use this function)
    even when i copy and paste the programme.

    the programme is this:
    Code:
    include <iostream.h>			
    int main()				//Most important part of the program!
    {
      int age;				//Need a variable...
      cout<<"Please input your age: ";	//Asks for age
      cin>>age;				//The input is put in age
      if(age<100)				//If the age is less than 100
      {
         cout<<"You are pretty young!";     //Just to show it works
      }
      else if(age==100)		//I use else just to show an example 
      {
         cout<<"You are old";		//Just to show you it works...
      }
      else
      {
        cout<<"You are really old";	//Executed if no other statement is executed
      }
      return 0;
    }

    your assistance wil be muchly appreciated
    thanks simon
    Last edited by vex; 03-13-2004 at 08:36 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Idiot spammer.
    By brewbuck in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 03-23-2009, 08:19 PM
  2. Feel Like An Idiot
    By golfinguy4 in forum A Brief History of Cprogramming.com
    Replies: 22
    Last Post: 07-04-2003, 12:45 PM
  3. Screaming idiot - shuttle "photo".
    By adrianxw in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 03-08-2003, 08:44 PM
  4. Replies: 0
    Last Post: 02-24-2002, 09:03 PM
  5. Idiot Canadians
    By Troll_King in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 10-15-2001, 07:35 AM