If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
cout Object के साथ double less than << sign का use करके C++ में Output print किया जाता है।
#include <iostream>
using namespace std;
int main() {
cout << "Hello World !";
return 0;
}
Hello World !
आप अपनी need के according कितने ही lines को cout object की help से print कर सकते हैं -
#include <iostream>
using namespace std;
int main() {
cout << "Hello Students";
cout << "How are you ?";
cout << "Who are you ? etc..";
return 0;
}
Hello StudentsHow are you ?Who are you ? etc..
जैसा कि आप ऊपर example में देख सकते हैं कि , एक से ज्यादा cout use करने पर सिर्फ output ही print ही रहा है , लेकिन output new line से print नहीं हो रहा है।
New line में output print करने के लिए slash n \n का use किया जाता है।
#include <iostream>
using namespace std;
int main() {
cout << "Hi !";
cout << "\nWelcome to learnhidnituts.";
cout << "\nHere you will find all the programming courses tutorials.";
cout << "\nKeep it up.";
return 0;
}
Hi ! Welcome to learnhidnituts. Here you will find all the programming courses tutorials. Keep it up.
एक या एक से ज्यादा variables को आप << की help से single line में print करा सकते हैं।
string name="Rahul Rajput"; string name="Rahul Rajput"; cout << "My Name is : " << name;
I Hope, आपको समझ में आ गया होगा कि C++ में किस तरह से output print करते हैं।
Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook