Answers for "convert c program to assembly language online"

C
0

convert c program to assembly language online

gcc –S program.cpp
Posted by: Guest on September-11-2021
0

convert c program to assembly language online

/**
 * C program to print hollow mirrored right triangle star pattern
 */

#include <stdio.h>

int main()
{
    int i, j, rows;

    /* Input rows from user */
    printf("Enter number of rows : ");
    scanf("%d", &rows);

    /* Iterate through rows */
    for(i=1; i<=rows; i++)
    {
        /* Print trailing spaces */
        for(j=i; j<rows; j++)
        {
            printf(" ");
        }

        /* Print hollow right triangle */
        for(j=1; j<=i; j++)
        {
            /*
             * Print star for last row(i==row),
             * first column(j==1) and
             * last column(j==i).
             */
            if(i==rows || j==1 || j==i)
            {
                printf("*");
            }
            else
            {
                printf(" ");
            }
        }

        printf("\n");
    }

    return 0;
}
Output
Posted by: Guest on September-11-2021

Code answers related to "convert c program to assembly language online"

Code answers related to "C"

Browse Popular Code Answers by Language