I have to read an integer value and pass it as parameter to a function. This should show the number using the sample format.
Ex: if the number you entered was 3, show:
1
1 2
1 2 3
I can show the format that asks the question, but not exactly how it asks.
Get it done.
ps: The @
character is just for testing.
void triangulo(int n){
int i, j;
for(i = 1 ;i <= n; i++){
for(j = 1 ;j <= i ; j++){
printf("@");
}
printf("\n");
}
}
int main(){
int n;
scanf("%d", &n);
triangulo(n);
return 0;
}