*
*
*
*
**
*
*pattern printing in C
Answers
Answered by
1
Answer:
what LVMH ignites GVC HD
Answered by
0
pattern printing in C
Output:
*
*
*
*
**
*
*
Explanation:
The pattern program to this question as follows:
Program:
#include <stdio.h> //defining header file.
int main() //defining main method
{
int i; //defining integer variable
for(i=0; i<7; i++) //loop for print value
{
//if block
if(i==4) //check condition
{
printf("**\n");//print value
}
else //else block
{
printf("*\n"); //print value
}
}
return 0;
}
Explanation of the program as follows:
- In the above C language program a firstly the main method is defined, inside this method an integer variable i is declared.
- In the next step, a for loop is declared, that uses variable "i" and inside a loop, a condition statement is used.
- In the if block, a condition is defined, when the value of i is equal to 4, it will print the double-asterisk (**).
- In the else block, it will print a single asterisk (*).
Learn more:
- What is asterisk: https://brainly.in/question/11062718
- Pattern program in C: https://brainly.in/question/13027846
Similar questions