How To Take Input From Keyboard In C++ - MeraForum Community.No 1 Pakistani Forum Community

MeraForum Community.No 1 Pakistani Forum Community

link| link| link
MeraForum Community.No 1 Pakistani Forum Community » The World of Information » Computer and Information Technology » C++ » How To Take Input From Keyboard In C++
C++ All Programs of C++ Languages

Advertisement
 
Post New Thread  Reply
 
Thread Tools Display Modes
(#1)
Old
Morash's Avatar
Morash Morash is offline
 


Posts: 17,781
My Photos: ()
Country:
Star Sign:
Join Date: Jul 2010
Location: ▌║█║▌│█│║▌║
Gender: Male
?? CLASS 2: How To Take Input From Keyboard In C++ - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-06-2014, 12:00 PM

A Simple Program Used For Taking Input From The Keyboard/User.









A Program Used For Taking Input From The Keyboard/User. I Have Declared Two Variables char And int Type Which Store The Value Entered By The User And Display It On Screen. For Input We Use cin>>variable_name; And For Output We Use cout<<"Output Message ";

char a[20]; Is Character Type Variable Which Stores 20 Characters

int b; Is Integer Type Variable Which Stores A Number

endl Is Used For End Of Line

\n Is Used For New Line







Output
















 





bE driveN wiTh puRpOse, Be r313n71355 in your alιgnмenт;
with excellence.
pAy n0 mInd to the ∂ιsιмραssισηε∂ เ๓ק๏tєภt ђคtєгร

.. нoolιgan

Last edited by Morash; 04-07-2014 at 11:18 PM.. Reason: Updated Title
Reply With Quote Share on facebook
Sponsored Links
(#2)
Old
PRINCE SHAAN PRINCE SHAAN is offline
 


Posts: 7,688
My Photos: ()
Country:
Join Date: Jul 2010
Location: PAKISTAN
Gender: Male
Default Re: How To Take Input From Keyboard In C++ - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-06-2014, 12:18 PM

Thanks for nice sharing........................

 

(#3)
Old
Morash's Avatar
Morash Morash is offline
 


Posts: 17,781
My Photos: ()
Country:
Star Sign:
Join Date: Jul 2010
Location: ▌║█║▌│█│║▌║
Gender: Male
Default Re: How To Take Input From Keyboard In C++ - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-06-2014, 07:33 PM

Shukriya ..

 





bE driveN wiTh puRpOse, Be r313n71355 in your alιgnмenт;
with excellence.
pAy n0 mInd to the ∂ιsιмραssισηε∂ เ๓ק๏tєภt ђคtєгร

.. нoolιgan
(#4)
Old
pakeeza's Avatar
pakeeza pakeeza is offline
 


Posts: 28,336
My Photos: ()
Country:
Star Sign:
Join Date: Jan 2012
Location: Maa ki duaon mey
Gender: Female
Default Re: How To Take Input From Keyboard In C++ - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-06-2014, 09:04 PM

Gooood Job

 



Be Positive... Everything Gonna be Alright

(#5)
Old
AYAZ's Avatar
AYAZ AYAZ is offline
 


Posts: 12,370
My Photos: ()
Country:
Star Sign:
Join Date: Aug 2008
Location: Karachi
Gender: Male
Default Re: How To Take Input From Keyboard In C++ - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-06-2014, 10:35 PM

Thanks for sharing morash. I tried it and it worked .

 







ALLAH FARMATA HAI :
AEY BANDEY JO HUA
WO ACHA HUA .
JO HORAHA HAI ACHA HO RAHA HAI.
JO HOGA WO BHI ACHA HOGA.
TERA KIYA GAIYA JO TU ROTA HAI
TU KIA LAYA JO TU NE KHO DIYA.
JO LIYA YAHIN (DUNYA) SEI LIYA
JO DIYA YAHIN (DUNYA) PE DIYA
JO AAJ TERA HAI PEHLAY KISI AUR KA THA
AUR KAL KISI AUR KA HOGA.
TABDEELI KAINAAT KA MAMOOL HAI
BAS TU WO JAMA KAR JO TU SATH LEI KAR JANEY WALA HAI
YANI NAIK AMAAL.


(#6)
Old
AYAZ's Avatar
AYAZ AYAZ is offline
 


Posts: 12,370
My Photos: ()
Country:
Star Sign:
Join Date: Aug 2008
Location: Karachi
Gender: Male
Default Re: How To Take Input From Keyboard In C++ - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-06-2014, 10:48 PM

Morash ek cheez hum nie yeh kyon use kara

cout << "Your name is "<<a<<endl;

yeh cout mei <<a<< kyon use kara hie?

 







ALLAH FARMATA HAI :
AEY BANDEY JO HUA
WO ACHA HUA .
JO HORAHA HAI ACHA HO RAHA HAI.
JO HOGA WO BHI ACHA HOGA.
TERA KIYA GAIYA JO TU ROTA HAI
TU KIA LAYA JO TU NE KHO DIYA.
JO LIYA YAHIN (DUNYA) SEI LIYA
JO DIYA YAHIN (DUNYA) PE DIYA
JO AAJ TERA HAI PEHLAY KISI AUR KA THA
AUR KAL KISI AUR KA HOGA.
TABDEELI KAINAAT KA MAMOOL HAI
BAS TU WO JAMA KAR JO TU SATH LEI KAR JANEY WALA HAI
YANI NAIK AMAAL.


(#7)
Old
Morash's Avatar
Morash Morash is offline
 


Posts: 17,781
My Photos: ()
Country:
Star Sign:
Join Date: Jul 2010
Location: ▌║█║▌│█│║▌║
Gender: Male
Default Re: How To Take Input From Keyboard In C++ - >>   Show Printable Version  Show Printable Version   Email this Page  Email this Page   04-07-2014, 02:02 AM

Quote:
Originally Posted by AYAZ View Post
Morash ek cheez hum nie yeh kyon use kara

cout << "Your name is "<<a<<endl;

yeh cout mei <<a<< kyon use kara hie?
<<a Es Liye Use Huwa Hai K Jo Value Hum Type Karte Hai, Wo a Mai Store Ho Jate Hai ..
Phir Os Value Ko Hum Display Karne K Liye Dosre Cout Statement K Saath Call Karte Hai ..

Like, Agar Hum Ye Use Na Karte To Phir Wo Second Cout Message Es Tarah Show Hota;
The Number You Entered Is: Aur Agy Wo Number Display Nai Hota ..

a Ko Remove Kar K Phir Program Ko Run Karo To Pata Lag Jaega Kis Liye Use Hota Hai =p

 





bE driveN wiTh puRpOse, Be r313n71355 in your alιgnмenт;
with excellence.
pAy n0 mInd to the ∂ιsιмραssισηε∂ เ๓ק๏tєภt ђคtєгร

.. нoolιgan
Post New Thread  Reply

Bookmarks

Tags
input, keyboard

« Previous Thread | Next Thread »
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Job in Public Sector Org Job, Data Input Operator, Assistant, Junior Clerk, driver AYAZ Jobs & Career 3 07-30-2013 07:03 PM
~ChOcOLate KeyBoard~ ~Pr!nCe$s UrOoJ~ Pics And Images 13 03-25-2013 05:35 PM
Use of old input pc device AYAZ Pics And Images 9 12-02-2011 09:31 PM
All KeyBoard Shortcuts (¯*♥¤»ƙɧՄՏɧՅԾԾ«¤♥*¯) Computer and Information Technology 13 04-20-2011 06:21 PM
100 keyboard shortcut DI@ Computer and Information Technology 7 01-28-2011 11:34 AM


All times are GMT +5. The time now is 03:13 PM.
Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.

All the logos and copyrights are the property of their respective owners. All stuff found on this site is posted by members / users and displayed here as they are believed to be in the "public domain". If you are the rightful owner of any content posted here, and object to them being displayed, please contact us and it will be removed promptly.

Nav Item BG