help urgent- need program in C language to print the picture

Status
Not open for further replies.

aminmahdi

Member level 1
Joined
Sep 11, 2006
Messages
35
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,516
help ergent

hi

i need a program in C language that print this picture:

note: between of every digit must be 3 blank character .

 

Re: help ergent

You may use 3 loops for that and seperate them with spaces. i didnt take care of location but it ll be more simple(study it by yourself)

Exp:

For i=1 to 5
{
for j=0 to (i-1) //
{
print (j+i)
print (' ')
}
for z=2 to i
{
print (2i-z)
print(' ')
}
}

Or reall code pascal:

begin
s:='';
For i:=1 to 5 do
begin
for j:=0 to (i-1) do
begin
s:=s+inttostr(j+i)+' ';
end;

for z:=2 to i do
begin
s:=s+inttostr(2*i-z)+' ';
end;
memo1.Lines.Add(s);
s:='';
end;


Good luck
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…