Question

Write a C program to print the love symbol. note: extecute the program in linux (prefer...

Write a C program to print the love symbol.

note: extecute the program in linux (prefer elementary os). show the execution command and output screenshots

note: I have searched online for many codes, but non of the shapes i liked. if u copy paste the code, i will give low rating.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code (hardcoded with cout for every line)

#include <stdio.h>

int main(){

    printf( "\n\n\n");

    for (int i = 0; i < 15; i++)

        printf( " ");

    printf( "#         #\n");

    for (int j = 0; j < 13; j++)

        printf( " ");

    printf( "#   #     #   #\n");

    for (int k = 0; k < 11; k++)

        printf( " ");

    printf( "#      #   #      #\n");

    for (int l = 0; l < 11; l++)

        printf( " ");

    printf( "#       # #       #\n");

    for (int m = 0; m < 11; m++)

        printf( " ");

    printf( "#        #        #\n");

    for (int n = 0; n < 11; n++)

        printf( " ");

    printf( "#                 #\n");

    for (int o = 0; o < 12; o++)

        printf( " ");

    printf( "#               #\n");

    for (int p = 0; p < 13; p++)

        printf( " ");

    printf( "#             #\n");

    for (int q = 0; q < 14; q++)

        printf( " ");

    printf( "#           #\n");

    for (int r = 0; r < 15; r++)

        printf( " ");

    printf( "#         #\n");

    for (int s = 0; s < 17; s++)

        printf( " ");

    printf( "#     #\n");

    for (int t = 0; t < 20; t++)

        printf( " ");

    printf( "##\n");

}

Add a comment
Know the answer?
Add Answer to:
Write a C program to print the love symbol. note: extecute the program in linux (prefer...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT