473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

much error and i'm newbie..

i have try many ways that i know... but i still don't get it what the problem

#include<iostream.h>

void main() {
int x;
cout<<"Masukkan umur Anda: ";
cin>>x;
if(x < 5)
cout<<"Wah, masih balita nih ^_^"<<endl;
elseif(x >= 5 && x < 12)
cout<<"Masih anak-anak ya?"<<endl;
elseif(x >= 12 && x < 17)
cout<<"Sudah remaja ni yee..."<<endl;
elseif(x >= 17 && x < 40)
cout<<"Sudah dewasa ya..."<<endl;
else
cout<<"Sudah tua toh..."<<endl;
}

that's the script.. and this is the problem

in line 8 it say : elseif should have a prototype
in line 9.5 it say : statement missing ;
in line 11.5 it say : statement missing ;
in line 13.5 it say : statement missing ;
Dec 5 '11 #1
2 1499
Rabbit
12,516 Expert Mod 8TB
It's else if, not elseif.
Expand|Select|Wrap|Line Numbers
  1. if (expression)
  2.   {
  3.     Block of statements;
  4.   }
  5. else if(expression)
  6.   {
  7.     Block of statements;
  8.   }
  9. else
  10.   {
  11.     Block of statements;
  12.   }
Dec 5 '11 #2
lspxy
12
it should be
Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void main() 
  5. {
  6.     int x;
  7.  
  8.     cout<<"Masukkan umur Anda: ";
  9.  
  10.     cin>>x;
  11.  
  12.     if (x < 5)
  13.         cout << "Wah, masih balita nih ^_^" << endl;
  14.     else if (x < 12)
  15.         cout << "Masih anak-anak ya?" << endl;
  16.     else if (x < 17)
  17.         cout << "Sudah remaja ni yee..." << endl;
  18.     else if (x < 40)
  19.         cout << "Sudah dewasa ya..." << endl;
  20.     else
  21.         cout << "Sudah tua toh..." << endl;
  22. }
  23.  
  24.  
Dec 7 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: varois83 | last post by:
Hi I am in the process of creating a guestbook for my site, I am a newbie and used several tutorials and customized them to what I need using the little knowledge I got. I get the following...
3
by: sheep | last post by:
Hi, I are trying to update my project from VC6 to VC7.1. However, I got the following error. Is there anyone knows what the error means and what I should do to solve this problem? Thank you very...
3
by: JeffM | last post by:
I have a .dat file on a remote server that seems to be locked. I have tried to FTP to it and delete it, rename it, copy over it and I get the error. "Could not copy temporary files to the output...
16
by: lawrence k | last post by:
I've made it habit to check all returns in my code, and usually, on most projects, I'll have an error function that reports error messages to some central location. I recently worked on a project...
1
by: puafo | last post by:
The following is the code I am using for the addnew and the select clause: <%Option Explicit%> <% IF session("sessionID") = "" THEN Response.Redirect "adminLogin.asp" END IF %> <%
1
by: FirstIIS | last post by:
Hello, please help i have 2 servers win 2k server with IIS 5.0 and trying to sync old server with new to have same web pages on both for backup web server so I have found a way that should work by...
0
by: AksIndya | last post by:
Hi All, I am a beginner with SSIS. Here I am with a simple extract mapping which extracts data from database (quite a few small tables and 3 big table @ 5million reacords each) simultaneously and...
4
by: Porty | last post by:
Hi all, I admittedly don't know the first thing about .NET. I have a new client who has been having problems on her website and asked me to look into it (she has lost contact with the programmer...
1
by: mimranp | last post by:
Hi all i m using visual developer 2008 i m using xhtml1.1 in that .i m reciving so much error when check in online input w3 standard(C# language code behind) <%@ Page Language="C#"...
3
by: Sean425 | last post by:
I've just started attempting to learn Java, but when I tried to compile my "Hello World" program I got an error. I'm hoping someone here can help me fix it, I imagine it won't be to difficult, a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.