Problem statement
Write a program to print following horizontal line as output.
**************************************************************************************
Program
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#include<stdio.h> void charline(int); int main() { int l=20; charline(l); } void charline(int l) { int i=0; while(i<=20) { printf("*"); } } |
Output
1 |
************************************************************************************* |
In above program we called a function ‘charline()’ from main.
In charline() we use while loop with 20 as limit of line.
Instead of * you can give any symbol to print line.