Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
662 B
5
Indexable
Never
//Author: Isis Villa
//Date: 09/23/23
//Silly Numbers

#include <stdio.h>
#include <stdlib.h>

int main (){
	int number, rows, r, s, x;
	
	//odd/even number??
	printf("Enter here any integer: ");
	scanf("%d", &number);
	//fix to say that it's even????? (it still says it's odd when it's even/??!??)
	if(number % 2 == '0'){
		printf("This number is even!\n");
	}
	if(number % 2 == '1'){
		printf("This number is odd!\n");
	}
	
	//pyramid?
	printf("How many rows?  ");
	scanf("%d", &rows);
	for(r = 1; r <= rows; r++){
		for(s = 1; s <= (rows - r); s++){
			printf(" ");
		}
		for(x = 1; x <= (2 * r) - 1; x++){
			printf("*");
		}
		printf("\n");
	}	
	return 0;
}