0

Hello good morning...I need help on how print the heart beside each other here is the code..

#include <stdio.h>  
#include<stdlib.h>
#include<Windows.h>

int heart()  
{  
    int i, j; 

    for(i=10/2; i<=10; i+=2)  
    {  
        for(j=1; j<10-i; j+=2)  
        {  
            printf(" ");  
        }  

        for(j=1; j<=i; j++)  
        {  
            printf("*");  
        }  

        for(j=1; j<=10-i; j++)  
        {  
            printf(" ");  
        }  

        for(j=1; j<=i; j++)  
        {  
            printf("*");  
        }  

        printf("\n");  
    }  

    for(i=10; i>=1; i--)  
    {  
        for(j=i; j<10; j++)  
        {  
            printf(" ");  
        }  

        for(j=1; j<=(i*2)-1; j++)  
        {  
            printf("*");  
        }  

       printf("\n");
    }  

    return 0;  
}  



void main(){
    int i;
heart();  


}
2
Contributors
2
Replies
10
Views
1 Year
Discussion Span
Last Post by progteacher2
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.