// Lyrics from David Bowie's Heroes
#include <stdio.h>
// You can store many sentences in one string, use
// the continuation character (the "\") after each line. You
// can add new lines and other special characters as needed
// to get the printing effect you need.
#define HEROES_VERSE1 "\nI, I wish you could swim \
\nLike the dolphins, like dolphins can swim \
\nThough nothing, \
\nnothing will keep us together \
\nWe can beat them, for ever and ever \
\nOh we can be Heroes, \
\njust for one day"
int main ( )
{
// You can store a quote in a variable as well.
// It does not matter if you put each sentence on a new line,
// the C program will just print characters until the null
// terminator is encountered
char heroes_verse2 [ ] = { "\n I, I will be king\n And you, you \
will be queen\n Though nothing will drive them away \n We can \
be Heroes, just for one day\n We can be us, just for one day"} ;
char song [ 5000 ] ; /* store a song */
printf ( "\n The first two verses of David Bowie's Heroes:\n " ) ;
/* Let store the two verses in one variable */
strcpy ( song
, HEROES_VERSE1
) ; /* input is a constant */ strcat ( song
, "\n " ) ; /* input is a new line character */ strcat ( song
, heroes_verse2
) ; /* input is a variable */
/* print the song */
printf ( "\n \n \n *** David Bowie's Heroes ***\n " ) ;
/* print number of characters in the song */
printf ( "\n \n Number of characters in the the song is: %i \n " ,
return ( 0 ) ;
}
Ly8gTHlyaWNzIGZyb20gRGF2aWQgQm93aWUncyBIZXJvZXMKI2luY2x1ZGUgPHN0ZGlvLmg+CgovLyBZb3UgY2FuIHN0b3JlIG1hbnkgc2VudGVuY2VzIGluIG9uZSBzdHJpbmcsIHVzZQovLyB0aGUgY29udGludWF0aW9uIGNoYXJhY3RlciAodGhlICJcIikgYWZ0ZXIgZWFjaCBsaW5lLiBZb3UKLy8gY2FuIGFkZCBuZXcgbGluZXMgYW5kIG90aGVyIHNwZWNpYWwgY2hhcmFjdGVycyBhcyBuZWVkZWQKLy8gdG8gZ2V0IHRoZSBwcmludGluZyBlZmZlY3QgeW91IG5lZWQuCgojZGVmaW5lIEhFUk9FU19WRVJTRTEgIlxuSSwgSSB3aXNoIHlvdSBjb3VsZCBzd2ltIFwKXG5MaWtlIHRoZSBkb2xwaGlucywgbGlrZS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mVyc2VzIGluIG9uZSB2YXJpYWJsZSAqLwogICAgc3RyY3B5IChzb25nLCBIRVJPRVNfVkVSU0UxKTsgLyogaW5wdXQgaXMgYSBjb25zdGFudCAqLwogICAgc3RyY2F0IChzb25nLCAiXG4iKTsgICAgICAgICAgLyogaW5wdXQgaXMgYSBuZXcgbGluZSBjaGFyYWN0ZXIgKi8KICAgIHN0cmNhdCAoc29uZywgaGVyb2VzX3ZlcnNlMik7IC8qIGlucHV0IGlzIGEgdmFyaWFibGUgKi8KICAgCiAgICAvKiBwcmludCB0aGUgc29uZyAqLwogICAgcHJpbnRmICgiXG5cblxuKioqIERhdmlkIEJvd2llJ3MgSGVyb2VzICoqKlxuIik7CiAgICBwcmludGYgKCIlcyIsIHNvbmcpOwoKICAgIC8qIHByaW50IG51bWJlciBvZiBjaGFyYWN0ZXJzIGluIHRoZSBzb25nICovCiAgICBwcmludGYgKCJcblxuTnVtYmVyIG9mIGNoYXJhY3RlcnMgaW4gdGhlIHRoZSBzb25nIGlzOiAlaSBcbiIsCiAgICAgICAgICAgIHN0cmxlbiAoc29uZykpOwoKICAgIHJldHVybiAoMCk7Cn0K
stdout
The first two verses of David Bowie's Heroes:
I, I wish you could swim
Like the dolphins, like dolphins can swim
Though nothing,
nothing will keep us together
We can beat them, for ever and ever
Oh we can be Heroes,
just for one day
I, I will be king
And you, you will be queen
Though nothing will drive them away
We can be Heroes, just for one day
We can be us, just for one day
*** David Bowie's Heroes ***
I, I wish you could swim
Like the dolphins, like dolphins can swim
Though nothing,
nothing will keep us together
We can beat them, for ever and ever
Oh we can be Heroes,
just for one day
I, I will be king
And you, you will be queen
Though nothing will drive them away
We can be Heroes, just for one day
We can be us, just for one day
Number of characters in the the song is: 342