Advertisement
Aminpro

[ECP 1016]Tutorial 6 & 7 Question 7

Jul 29th, 2012
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.84 KB | None | 0 0
  1. //https://www.facebook.com/AminproPastebin
  2.  
  3. #include <stdio.h>
  4.       void pattern (char pat, int num);
  5.       int main(){
  6.               char data_A;
  7.               char data_B;
  8.      
  9.               printf("Enter the pattern of intrest: ");
  10.               scanf("%c", data_A);
  11.               printf("Enter an interger for the pattern: ");
  12.               scanf("%d", data_B);
  13.               pattern(data_A, data_B);
  14.       }
  15.  
  16.       void pattern (char pat, int num){
  17.  
  18.               int count;
  19.               int row;
  20.               for(row=num; row>=1; row --){  
  21.  
  22.                       for (count=num; count>=0; count--){
  23.                       printf("%c", pat);
  24.                       }
  25.                       num = num -1;
  26.                       printf("\n");
  27.               }
  28.  
  29.               printf("%c", pat);
  30.  
  31.              
  32.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement