473,320 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Drawing an Inverted Triangle

Expand|Select|Wrap|Line Numbers
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.  int i=0, j;
  7.  while (++i<10) {
  8.        j=9;
  9.        while (++j<=i) {
  10.              printf("*");
  11.              }
  12.              printf("\n");
  13.              } 
  14.   system("PAUSE");    
  15.   return 0;
  16. }
Hey everyone, I am a newbie in C language and this is my first major obstacle in completing a tutorial in my preparatory course....I was experimenting with the code above to try to created an "inverted triangle" by using nested loop...This code was modified from the code given for creating a right-side up triangle...Anyone can show me how to do an "inverted triangle"? Also, I also don't understand what i and j exactly plays in the role in creating this triangular shape.
Aug 7 '07 #1
1 6063
pbmods
5,821 Expert 4TB
Heya, Geosondaman. Welcome to TSDN!

Changed thread title to better describe the problem (did you know that threads whose titles contain three words or less actually get FEWER responses?).

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

I'm going to go ahead and move this thread to the C forum, where our resident Experts will be better able to help you out.
Aug 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ron Adam | last post by:
I want to be able to easily create reusable shapes in Tkinter and be able to use them in mid level dialogs. So after some experimenting I've managed to get something to work. The following does...
3
by: The New iSoftware Company | last post by:
Any one know how to center a control like the image editors on the market (fireworks/photoshop/etc)? This way should support scrolling and zoom. Is there a way to draw overlays that is inverted...
0
by: lottoman | last post by:
Hello all, I am trying to draw a triangle on a toolbarbutton to simulate a drop down button without having the extra button beside my drop downbutton. I was successfully able to draw the...
0
by: Prashant | last post by:
Hi, I want to print a triangle on crystal report(or any another report), but the 3 points of the triangle will vary based on the values (x1,y1) of 3 points of the triangle.(I will specify 3...
5
by: singhm | last post by:
Hi guys so I have a trianlge program having hard time finishing this though, I have to develop a program which is the following: Write a program that will allow the user to enter the 3 lengths...
19
by: lost1 | last post by:
Can someone point me in the right direction on how to get the triangle type to display. Below is a triangle class that is tested by another completely separate class. The main method of the test...
5
by: steve | last post by:
I would like to create a panel, or other widget, on which I can draw, say, a triangle, and use the wheel on the mouse to zoom in and out on the drawing. A vector drawing. I know this can be done...
15
by: bH | last post by:
Hi All, I have been looking at javascript drawing from this website : http://www.cwdjr.net/geometricDraw/pentagon_draw.html" and I am wondering why the author made it into two images : upper...
1
by: lindafay1123 | last post by:
Hello, I have been tring to write the visual basic program that will out put a triangle. A program the requests an odd number and start the triangle with that number and go down with odd numbers...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.