Display a horizontal line as per specified input.

#include <stdio.h>
#include <conio.h>

void hline(int, int, int);

int main(void)
{
int row, col, length;
clrscr();

printf("\nEnter beginning row and column : ");
scanf("%d%d", &row, &col);
printf("\nEnter length : ");
scanf("%d", &length);

hline(row,col,length);

return 0;
}

void hline(int row, int col, int length)
{
for( ; length > 0 ; length--)
{
gotoxy(col, row);
printf("%c",196);
col++;
}
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin