15,896,278 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by vikasvds (Top 5 by date)
vikasvds
7-Sep-10 5:53am
View
Reason for my vote of 5
good explaination
vikasvds
16-Jul-10 8:10am
View
Hi,
Sorry to not to paste code written by me.
I am almost able to get it with one loops but i am not liking too many variables and if-else.
i am unable to think of any single straight logic/equation to do the same
it is below here -
#define ROWS 10
int main(void)
{
int i = 0, j = 0, counter = 0, start_shrinking = 0;
for(i = 0; i = ((ROWS/2)-j))
printf("*");
else
printf(" ");
counter++;
}
}
}
output is not exactly * arranged in diamond shape as given below
_____*
____***
___*****
__*******
_*********
__*******
___*****
____***
_____*
i have used underscore instead of spaces since in HTML all spaces were disappeared.
This is not the homework i am curiously doing it.
Thanks very much
vikasvds
16-Jul-10 8:10am
View
Hi,
Sorry to not to paste code written by me.
I am almost able to get it with one loops but i am not liking too many variables and if-else.
i am unable to think of any single straight logic/equation to do the same
it is below here -
#define ROWS 10
int main(void)
{
int i = 0, j = 0, counter = 0, start_shrinking = 0;
for(i = 0; i = ((ROWS/2)-j))
printf("*");
else
printf(" ");
counter++;
}
}
}
output is not exactly * arranged in diamond shape as given below
_____*
____***
___*****
__*******
_*********
__*******
___*****
____***
_____*
i have used underscore instead of spaces since in HTML all spaces were disappeared.
This is not the homework i am curiously doing it.
Thanks very much - vikasvds 1 hour ago
vikasvds
16-Jul-10 6:30am
View
Hi all,
Sorry to not to paste code written by me.
I am almost able to get it with one loops but i am not liking too many variables and if-else.
i am unable to think of any single straight logic/equation to do the same
it is below here -
#define ROWS 10
int main(void)
{
int i = 0, j = 0, counter = 0, start_shrinking = 0;
for(i = 0; i <= ROWS*ROWS; i++)
{
if(i != 0 && i%ROWS == 0)
{
printf("
");
if(j < (((ROWS)/2)-1) && 0 == start_shrinking )
{
j++;
}
else
{
j--;
start_shrinking = 1;
}
counter = 0;
}
else
{
if(counter <= ((ROWS/2)+j) && counter >= ((ROWS/2)-j))
printf("*");
else
printf(" ");
counter++;
}
}
}
output is not exactly * arranged in diamond shape as given below
_____*
____***
___*****
__*******
_*********
__*******
___*****
____***
_____*
i have used underscore instead of spaces since in HTML all spaces were disappeared.
This is not the homework i am curiously doing it.
Thanks very much
vikasvds
3-Jun-10 10:21am
View
Thank you very much!!
Your explanation cleared my doubt.
Thanks again.