TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
manoj kumar
NA
147
139.5k
C #
Oct 10 2010 1:38 PM
Hi convert this program in C #..
#include<stdio.h>
int
main
(
)
{
char
prnt
=
'*'
;
int
i
,
j
,
k
,
s
,
p
,
r
,
nos
=
7
;
for
(
i
=
1
;
i
<=
5
;
i
++
)
{
for
(
j
=
1
;
j
<=
i
;
j
++
)
{
if
(
(
i
%
2
)
!=
0
&&
(
j
%
2
)
!=
0
)
{
printf
(
"%3c"
,
prnt
)
;
}
else
if
(
(
i
%
2
)
==
0
&&
(
j
%
2
)
==
0
)
{
printf
(
"%3c"
,
prnt
)
;
}
else
{
printf
(
" "
)
;
}
}
for
(
s
=
nos
;
s
>=
1
;
s
--
)
{
// for the spacing factor
printf
(
" "
)
;
}
for
(
k
=
1
;
k
<=
i
;
k
++
)
{
//Joining seperate figures
if
(
i
==
5
&&
k
==
1
)
{
continue
;
}
if
(
(
k
%
2
)
!=
0
)
{
printf
(
"%3c"
,
prnt
)
;
}
else
{
printf
(
" "
)
;
}
}
printf
(
"
\n
"
)
;
nos
=
nos
-
2
;
// space control
}
nos
=
1
;
// remaining half..
for
(
p
=
4
;
p
>=
1
;
p
--
)
{
for
(
r
=
1
;
r
<=
p
;
r
++
)
{
if
(
(
p
%
2
)
!=
0
&&
(
r
%
2
)
!=
0
)
{
printf
(
"%3c"
,
prnt
)
;
}
else
if
(
(
p
%
2
)
==
0
&&
(
r
%
2
)
==
0
)
{
printf
(
"%3c"
,
prnt
)
;
}
else
{
printf
(
" "
)
;
}
}
for
(
s
=
nos
;
s
>=
1
;
s
--
)
{
printf
(
" "
)
;
}
for
(
k
=
1
;
k
<=
p
;
k
++
)
{
if
(
(
k
%
2
)
!=
0
)
{
printf
(
"%3c"
,
prnt
)
;
}
else
{
printf
(
" "
)
;
}
}
nos
=
nos
+
2
;
// space control
printf
(
"
\n
"
)
;
}
return
0
;
Reply
Answers (
3
)
Connecting a NumericUpDown and TrackBar
Display SW direction arrow in Console,C sharp.