Page 1 of 1

My Simple C++ Program which hangs out with Age :)

Posted: Mon Apr 04, 2011 12:44 pm
by Nipuna
Here is a Simple Program I Wrote Today Using Dev C++ :)

I started Learning C++ Few Days ago (May be 4 Days or Low, I couldn't study some days because of some little things :) )

I used Do while Loop, I made some programs using " If" and "While". But this is the only one Left I deleted the others. :)

Code: Select all

#include<iostream>
#include<string>
#include<sstream>
using namespace std;

int main ()
{

string age;
int iage;

cout<<"Enter your Age [Enter Number Below 18] :";
getline(cin,age);
stringstream (age)>>iage;
cout<<iage<<" You are Still a Kid.... Press Enter for the Rest  \n";

cin.get();

do
{
            iage++;
            cout<<iage<<" , ";     
}

    while(iage<18);

cout<<"Now You Are An Adult :D";

cin.get();

return 0;
}



Tell Me your Ideas I like to Know :)

Re: My Simple C++ Program which hangs out with Age :)

Posted: Fri Apr 08, 2011 1:33 am
by Neo
No time to read programs. If you have a problem/error, ask the question by mentioning the line number.