🔒 Closed Patulong naman po kung anong kulang sa code c++

Status
Not open for further replies.

Social12

Fanatic
ito po yung problem:
Write a program to display the output below: You may input number of rows and colums.
Sample Output if Applicable


*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
* * * * * * * * * * *

ito po yung code ko:

#include <stdio.h>


int main()
{
int rows, i, j, space;

printf("Input number of rows:");
scanf("%d",&rows);
for(i = 1; i <= rows; i++)
{
for(space = i; space < rows; space++)
{
printf("");
}
for(j = 1; j <= (2 * i - 1); j++)
{
printf("*",);
}

printf("\n");
}

return 0;
}

Ang out put po ng code ko is Half lang di po sya full na pyramid ano po kaya kulang?
 
1.webp
 
ay maam mali po pala yung sample out put na nalagay ko ito po pala yung sample output dapat
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
* * * * * * * * * * *
 
[XX='Social12, c: 299083, m: 1093495'][/XX] pyramid po sya maam hindi po sya half lang, di sya nagiging pyramid pag na i comment po kasi
 
Status
Not open for further replies.

About this Thread

  • 7
    Replies
  • 460
    Views
  • 4
    Participants
Last reply from:
homer_simpson

Online now

Members online
1,008
Guests online
893
Total visitors
1,901

Forum statistics

Threads
2,276,228
Posts
28,968,452
Members
1,231,174
Latest member
JJJJMMMM
Back
Top