GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 24-Oct-2003, 21:26
laputa9000 laputa9000 is offline
New Member
 
Join Date: Oct 2003
Posts: 2
laputa9000 is an unknown quantity at this point
Angry

How to write simple program like ........?


Greeting,

I am beginner in C.

I would like to a program that ask the user to enter name, id and number of credit in C, and printf the user input.


Thank you for your time.
  #2  
Old 28-Oct-2003, 11:13
Dawis Dawis is offline
Awaiting Email Confirmation
 
Join Date: Oct 2003
Location: Latvia, Ogre
Posts: 7
Dawis is an unknown quantity at this point
I am not familar with printf function but you can do this job with cin and cout...
you can write something like this
CPP / C++ / C Code:
#include <iostream>
char name[20], surname[20], profession[20];
char id[10];
int i;
int main()
{
cout<<"Enter your name"<<endl;
cin.getline(name,20);
cout<<"Enter your surname"<<endl;
cin.getline(surname,20);
cout<<"Enter your profession"<<endl;
cin.getline(profession,20);
cout<<"Enter your ID"<<endl;
cin.getline(id,10);
cout<<"---------------------------------"<<endl;
cout<<"Your name is: "<<name<<endl;
cout<<"Your surname is: "<<surname<<endl;
cout<<"Your profession is: "<<profession<<endl;
cout<<"Your ID is: "<<ID<<endl;
cout<<"----------------------------------"<<endl;
cin>>i;//promts user to enter an integer but in this case
          //it will work pretty much like the brake for your program
          //so you can see what ithas done before it closes

return 0;
}
  #3  
Old 29-Oct-2003, 10:14
laputa9000 laputa9000 is offline
New Member
 
Join Date: Oct 2003
Posts: 2
laputa9000 is an unknown quantity at this point
Thumbs up

Thank You very much Dawis!


  #4  
Old 29-Oct-2003, 12:09
Dawis Dawis is offline
Awaiting Email Confirmation
 
Join Date: Oct 2003
Location: Latvia, Ogre
Posts: 7
Dawis is an unknown quantity at this point
Wink

no problems,
..learn fast and much so soon you can help me too
 
 

Recent GIDBlogMeeting the populace by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run a program saintsnow75 C++ Forum 1 27-Nov-2003 11:06
Help with calendar program mike3340 C++ Forum 0 18-Nov-2003 20:25
error during program rjd72285 C++ Forum 0 11-Nov-2003 18:49
one program access another? dgoulston C++ Forum 1 07-Oct-2003 11:26
Generating simple URLs for search engines jrobbio MySQL / PHP Forum 1 17-Mar-2003 11:22

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 04:56.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.