Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main(){
- /*
- *******
- *Hello*
- *World*
- *of *
- *c *
- *print*
- *******
- */
- char s_arr[10][10];
- int n;
- printf("enter the number of words: ");
- scanf("%d", &n);
- printf("Enter the strings: \n");
- for(int x=0; x<n; x++){
- scanf("%s", s_arr[x]);
- }
- int max_char = 1;
- for(int i=0; i<5; i++){
- if(strlen(s_arr[i])>max_char){
- max_char = strlen(s_arr[i]);
- }
- }
- for(int a=0; a<12; a++){
- printf("*");
- }
- printf("\n");
- for(int b=0; b<n; b++){
- printf("*%-10s*\n", s_arr[b]);
- }
- for(int a=0; a<12; a++){
- printf("*");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement