I am writing a function called triagle that accepts two parameters 1) the length of a isosceles right triangle and 2) the letter to print. It should print like this
LLLLL
LLLL
LLL
LL
L
Here is what I have so far. I am not sure what I need to call to get the main to read in my function.
Code:
#include <stdio.h>
int triangle(int length, int letter)
{
int i, j;
for(i = 1; i <= length; i++);
{
for(j = 1; j <=length; j++);
}
return j;
}
int main (void)
{
int length;
int letter;
printf("enter the length of a isoceles triangle: \n");
scanf("%d", &length);
printf("enter a letter: \n");
scanf("%d", &letter);
printf("%d\n", triangle(length, letter));
return 0;
}
sorry if the spacing and alignment are off