|
-
January 18th, 2011, 04:04 AM
#3
Member
dear mostafaxx, to take three user's age you should use an array, please take a look on arrays in C/C++ language. then
at for (i=1 ; i<=5 ; i++) //statement says that you are taking input 5 times.
and last thing you should mention here that a user should enter a value like 20 or 35 etc --->printf("user number %i Enter your Age in values like 20 or 35 : ",i);
continue your struggle.
int age[3],i;
clrscr();
for(i=0;i<3;i++)
{ cout<<"please enter age of "<<i+1<<" person";
cin>>age[i];
}
for(i=0;i<3;i++)
cout<<age[i];
Similar Threads
-
By AngelicKnight in forum General Computer Discussions
Replies: 14
Last Post: June 15th, 2006, 04:04 AM
-
By IcSilk in forum Operating Systems
Replies: 8
Last Post: October 30th, 2005, 11:01 PM
-
By Tedob1 in forum Tech Humor
Replies: 0
Last Post: December 23rd, 2002, 04:58 PM
-
By Rna in forum General Programming Questions
Replies: 4
Last Post: May 22nd, 2002, 07:03 AM
-
By thesecretfire in forum Hardware
Replies: 16
Last Post: May 17th, 2002, 12:31 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|