Post: How to write a sentence in C++
10-24-2010, 11:29 PM #1
Superahm
< ^ > < ^ >
(adsbygoogle = window.adsbygoogle || []).push({}); So the new section open'd and i thought i should do some research.

I found out how to write a sentence in the programming language C++.

Writing a sentence is a input and output method.

Blue is input, and Green is the output.

    [COLOR="Blue"]cout << SuperHam";[/COLOR]
// Prints SuperHam on screen.

To write a paragraph you need to do a line-break.

The code for line-break is \n.

    [COLOR="Blue"]cout << Supeham \nIs a newb at C++";[/COLOR]
// Prints
SuperHam
Is a newb at C++


Lets write a little story

    [COLOR="Blue"]cout << SuperHam's Story";[/COLOR]

    [COLOR="Blue"]cout << One day a SuperHam was born.\nHis SuperPig parents named him, TheSuperHam.";[/COLOR]

    [COLOR="Blue"]cout << The End :y:";[/COLOR]


// Prints on screen...

SuperHam's Story
One day a SuperHam was born.

His SuperPig parents named him, TheSuperHam.
The End :y:
(adsbygoogle = window.adsbygoogle || []).push({});

The following user thanked Superahm for this useful post:

iAce
10-24-2010, 11:37 PM #2
iAce
Gym leader
Cool stuff, Thanks for taking time and explaining this.
10-24-2010, 11:41 PM #3
This info is already in the stickies

Closed

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo