Hi dear forum members,

I am brand new in C programming and have to program an "X" as homework (see attached picture).
The edge length of the "X's" should be entered by the user, ie the "X" should be arbitrarily large or small.

Can someone help me with the task?

So far I have the following code:

include <stdio.h>
int main () {
int edge length, i;
printf ("Please enter the edge length of the pattern: \ n");
scanf ("% d", & edge length);

char sign;
character = '';

for (i = 0; i <edge length; i ++) {
printf ("-% c- \ n", character);

}
return 0;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.