Using nested for loops, how do I write a program that asks the user to input an integral number and then displays a diagonal line with that many dots on the console screen starting in the column?

An input of 4 would display four diagonal periods, while an input of 5 would display five diagonal periods, etc.


other info: Write the program in such a way that the character printed diagonally as well as the leader character(s) preceding it may be changed easily without digging through the actual code to find them, that is, use macros to define these characters.

Thanks for your help :)

this will display N diagonal periods...


main() {
	int i,j,number;
	printf("Enter an integer: ");
	for (i=1;i<=number;i++) {
		for (j=1;j<=i;j++) {
			if (j==i) {
			else {
				printf(" ");
Be a part of the DaniWeb community

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