Displaying "*" symbol 20 times in c| |Display * in c|

 C program to display the symbol "*" 20 times

code:

#include<stdio.h>
int main()
{ int i, n=20;
for(i=0; i<n; n--)
   printf("\n*");
return 0;
}

note: You can also use any symbols in the place of "*".
 

Explanation:

  • This is simple and easy to code and understand .
  • The first step is to declare the variables.
  • use a for loop to print the symbol "*" for 20 times
  • The last step is to printf the "* one by one.

Output:



Comments

Popular posts from this blog

Use of Backslash "\n" in C language

COHESION AND COUPLING material

Coding and Testing in software engineering