Can someone please help me with the question no.1 ??
Please do help fast
Attachments:
Answers
Answered by
1
This is not the pattern given in your book but this can help you
#include <stdio.h> int main() { int row, c, n, temp; printf("Enter the number of rows in pyramid of stars you wish to see "); scanf("%d",&n); temp = n; for ( row = 1 ; row <= n ; row++ ) { for ( c = 1 ; c < temp ; c++ ) printf(" "); // space temp--; for ( c = 1 ; c <= 2*row - 1 ; c++ ) printf("*"); printf("\n"); } return 0; }
#include <stdio.h> int main() { int row, c, n, temp; printf("Enter the number of rows in pyramid of stars you wish to see "); scanf("%d",&n); temp = n; for ( row = 1 ; row <= n ; row++ ) { for ( c = 1 ; c < temp ; c++ ) printf(" "); // space temp--; for ( c = 1 ; c <= 2*row - 1 ; c++ ) printf("*"); printf("\n"); } return 0; }
djtrivedi:
It's djtrivedi
please send me at
it's
Similar questions
English,
8 months ago
Biology,
8 months ago
English,
8 months ago
Math,
1 year ago
Math,
1 year ago
Psychology,
1 year ago
Environmental Sciences,
1 year ago
English,
1 year ago