Question

Write a C program to display the output below. Not: Use for loop only. ... ******** TT T Arial 3 (12pt) T-E- E - 3.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

Explanation:

#include <stdio.h>

#include <stdio.h>

int main()
{
    int i,j; //declaration of variable i and j
    for(i=0;i<7;i++){ // looping 7 times from i = 0 to 6 for 7 lines
        for(j=i;j<13-i;j++){ // looping 13 times from j = i to j = 13-i for printing *
            printf("*"); //printing *
        }
        if(i != 6){ //if i ! = 6 then changing line
        printf("\n");
        }
      
        for(j=0;j<i+1;j++){ // printing space based on i value
            printf(" ");
        }
      
    }
    for(i=7;i>0;i--){ //looping 7 times for 7 lines
        for(j=0;j<=i-1;j++){ //printing spaces based on value of i
            printf(" ");
        }
        for(j=13-i;j>i;j--){ // looping based on value of i and j
           printf("*"); //printing *
        }
        printf("\n"); //changing line
    }
    for(i=0;i<5;i++){   // looping 5 times from i =0 to i =4 for 5 lines
        for(j=0;j<4;j++){ // looping 5 times from j = 0 to j= 4
            printf(" "); //printing spaces
        }
        for(j=0;j<5;j++){ //looping 5 times from j =0 to j=4
            printf("*"); //printing *
        }
        printf("\n"); //changing line
    }

    return 0;
}

5 int main() int i, j; for(i=0;i<7;i++){ for(j=i;j<13-i;j++){ printf(*); if(i != 6){ printf(\n); for(j=0; j<i+1;j++){ pri

***** ***** *** ********* ポポポポポポポ**** ポポポポポポポポポポポポポ $main $gcc -o main *.c

I have explained each and every step with the help of code with comments attached at the right of every statement and also attached the code of compiler with the output of compiler.

Add a comment
Know the answer?
Add Answer to:
Write a C program to display the output below. Not: Use for loop only. ... ********...
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
  • how to write it in pandas Question 4 Use a suitable command to show only 3...

    how to write it in pandas Question 4 Use a suitable command to show only 3 columns that are "dateRep", "cases" and "countriesAndTerritories". TT TT Paragraph Arial %DOQO fx Mashups - 16 © © £ 3 (12pt) - E - T- TTO IT - - - 5 : EEEE # 1 HTML CSS

  • c++ ( while loop ) Write program to find and display the value of the function...

    c++ ( while loop ) Write program to find and display the value of the function y ,given as following : y = 15x3 + √2x − 3, for the values of x in between 2 and 10, with an increment of 1.

  • plz help the inoculating loop After you use an inoculating loop to transfer bacteria from a...

    plz help the inoculating loop After you use an inoculating loop to transfer bacteria from a culture tube onto a slide, you should before putting it away For the toolbar, press ALT+F10 (PC) or ALT-FN-F10 (Mac). TTTT Paragraph Arial 3 (12pt) E - T %D0Q TT. Пнти се QIX I Path: P Words:0 QUESTION 3 In lab, bacterial cultures (Petri plates and tubes of culture broth) should be kept covered at all times. This is partly to protect us from...

  • Write G-code program to machine the part shown in the figure below using a CNC lathe...

    Write G-code program to machine the part shown in the figure below using a CNC lathe machine. ci R16 Ø100 035 46 36 Given conditions: tool Number 6, absolute coordinate, feed rate 20 mm/min, and spindle speed 500 RPM with CW. TT T Arial • 3 (12pt) E's

  • NOTE: Write the Program in python as mentioned below and use while loop and flags as...

    NOTE: Write the Program in python as mentioned below and use while loop and flags as necessary. And please write the code following the program description given below. Directions: Read the program description below carefully. All requirements must be met by your program to receive full credit. Thus, pay particular attention to input and output requirements, structural requirements, and so on. Furthermore, code that contains syntax errors will not receive any credit, so be sure that your code interprets correctly...

  • NOTE: Write the Program in python as mentioned below and use while loop and flags as...

    NOTE: Write the Program in python as mentioned below and use while loop and flags as necessary. And please write the code following the program description given below. DON'T use Function concept or any other concept except while loop,if-else. Directions: Read the program description below carefully. All requirements must be met by your program to receive full credit. Thus, pay particular attention to input and output requirements, structural requirements, and so on. Furthermore, code that contains syntax errors will not...

  • solve it with Java please Write a Java program that prompts the user to input length...

    solve it with Java please Write a Java program that prompts the user to input length and width of a shape. If length is equal to width, call a method to calculate the area of the shape and send only one side as parameter to this method. This meth return the area of the shape. If length is not equal to width, call a method to calculate the area of the shape and send both width and length as parameters...

  • Write a C++ program to display workers schedule for a company. To accomplish this (1) Write...

    Write a C++ program to display workers schedule for a company. To accomplish this (1) Write a struct Time with attributes (at least) : hours, minutes and seconds. Add other functions or attributes you need to get the job done (2) Write a class Schedule with attributes : Day of week, start_time, end_time and activity. Schedule should have at least (a) Display to display the schedule (b) Length to return the duration of the schedule (ie end_time - start_time), (c)...

  • Write a program that prompts the user to input daily rainfalls and display the total and...

    Write a program that prompts the user to input daily rainfalls and display the total and average rainfall. Use a sentinel controlled loop with sentinel value of -1.   Your output values should only have three digits after the decimal point. Test your program with following input data. 0.31 0.0 0.52 0.79 1.15 1.23 0.93 0.0 0.0 -1 The output of the program should be: The total rainfall is : 4.930 The average rainfall is : 0.547 Copy and paste your...

  • QUESTION 9 Is the profit-maximizing price and output of a monopoly the same as those of...

    QUESTION 9 Is the profit-maximizing price and output of a monopoly the same as those of a perfectly competitive market? If diferent, how is it different? T- E 3(12pt) TTT Arial Words 0 Path: p QUESTION 10 Why does a monopoly result in both productive and alocative inefficiency? T TT Arial T IE 3 (12pt) Words 0

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
ADVERTISEMENT