-1
#include<stdio.h>
 

void main()
{ int i=1,j=1,n=9;
printf("enter the char");
scanf("%d",&n);

while(i<=n)
{
while(j<=i)
{
printf("%d/0",i);
j++;
}
printf("/n");
i++;
}
 
}

OUTPUT
1
22
333
4444
55555

Edited by hsetaknev: n/a

3
Contributors
5
Replies
7
Views
6 Years
Discussion Span
Last Post by vinitmittal2008
0

what do u mean by 'enter the char' and read it as an integer.

Edited by mfaisalm: n/a

0

thanks dude,but though the mistakes uve told arent syntax errors arent they
i ment "im not able to get oput"
in the sense i am not able to execute the program
and during compilation it gives no error

0

I think this code helps you

#include<stdio.h>


void main()
{ int i=1,j=1,n=9;
printf("enter the No");
scanf("%d",&n);

while(i<=n)
{
while(j<=i)
{
printf("%d\0",i);
j++;
}
printf("\n");
i++;
j=1;
}

}

Do u expect this?

0

@hsetaknev

line 4:

void main()

main always returns a int value so it must be

int main()

line 5:
when you are asking to the user for the value of n then
no need to initialize n=9.
line 13:
could'nt unserstand the need of /0 here even its \0.. no need for it.
line 16:
Its '\n' not '/n'.
Line 19:
place

return 0;

Post your code in proper format..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.