Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char ch;
- int main(){
- int num,a,b,x;
- void display(int,char);
- do{
- printf("Enter a number (3-9): ");
- scanf("%d",&num);
- }while (num<3 || num>9);
- do{
- printf("Enter a Character (A-P): ");
- __fpurge(stdin);
- scanf("%c",&ch);
- }while (ch<'A' || ch>'P');
- display(num,ch);
- return (0);
- }
- void display(int x, char y){
- int i,j;
- for(i=0;i<x;i++){
- for(j=0;j<x;j++){
- printf("%c ",ch);
- }
- printf("\n");
- ch++;
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement