Pls someone help me...
|
Newbie Member
|
|
| 9Sep2009,12:25 | #1 |
|
how to make a program that will make an output of a triangle figure composed of astirisks using C++.
|
|
Mentor
|
![]() |
| 9Sep2009,13:15 | #2 |
|
So, you've just started on a programming course, eh? How did I guess.
Break it down into simple steps. Start with a program that prints a line of stars. Then change it so that it prints a line of n stars where you can specify the value of n (within the program). Code:
int n=5; // code that prints a line of n stars |
|
Newbie Member
|
|
| 9Sep2009,14:05 | #3 |
|
can u teach me how to make a figure of triangle composed of astirisks by using loopings?
|
|
Mentor
|
![]() |
| 9Sep2009,14:29 | #4 |
|
If what I just posted doesn't answer that question, then no, obviously I can't.
|
|
Newbie Member
|
|
| 17Sep2009,12:32 | #5 |
|
Code: CPP
Last edited by SaswatPadhi; 17Sep2009 at 12:49.. Reason: Code-Blocks |
|
~ Б0ЯИ Τ0 С0δЭ ~
|
![]() |
| 17Sep2009,12:51 | #6 |
|
Good work
![]() But, please always post code within [code].....[/code] And, as you have not mentioned the return type of main(), it's int by default; so remember to add return 0; at the end. |
|
Banned
|
|
| 19Sep2009,13:44 | #7 |
|
the coding is written for a simple floyd triangle looking like below!
* here th no. of lines is :7* * * * * * * * * * * * * * * * * * * * * * * * * * * Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int m;
clrscr();
printf("enter the terms :");
scanf("%d",&m);
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n-i;j++)
printf(" ");
for(j=1;j<=i;j++)
printf("* ");
printf("\n");
}
getch();
}
![]()
|
|
Newbie Member
|
|
| 28Sep2009,17:15 | #8 |
|
how to make multiplication table using c++?
|
|
Mentor
|
![]() |
| 28Sep2009,19:08 | #9 |
|
What do you want the program to display?
Can you work out how to display part of that display? For example a multiplication table might read 1x2=2 2x2=4 3x2=6 Let's leave the difficult part of working out the solution for now, so let's write a program that just displays 1x2= 2x2= and so on. Can you work out how to do that? |




