Sie sind auf Seite 1von 2

2/3/2019 www.skillrack.com/faces/candidate/dailychallenge.xhtml?

k=DC

Daily Challenge

 LeaderBoard & Yesterday's Solution(/faces/candidate/leaderboarddailychallenge.xhtml?RT=DAILYCHALLENGE)

ProgramID- 7843 Solved By 714 Users SkillRack

Patttern - Asterisk with Alphabets

The program must accept an integer N as the input. The program must print the desired pattern as
shown in the Example Input/Output section.

Boundary Condition(s):
1 <= N <= 26

Input Format:
The rst line contains the value of N.

Output Format:
The rst N lines containing the desired pattern as shown in the Example Input/Output section.

Example Input/Output 1:
Input: 
4

Output:
***A
**ABA
*ABCBA
ABCDCBA

Example Input/Output 2:
Input: 
7

Output:
******A
*****ABA
****ABCBA
***ABCDCBA
**ABCDEDCBA
*ABCDEFEDCBA
ABCDEFGFEDCBA

Ambiance

http://www.skillrack.com/faces/candidate/dailychallenge.xhtml?k=DC 1/2
2/3/2019 www.skillrack.com/faces/candidate/dailychallenge.xhtml?k=DC

C 


1 #include<stdio.h>
2 #include <stdlib.h>
3
4 int main()
5 {int N,i,j,chary=65;
6 scanf("%d",&N);
7 for(i=0;i<N;i++){
8 for(j=0;j<(2*N-1);j++){
9 while(j<N-1){
10 printf("*");
11 j++;
12 }
13 while()
14 printf("%c",chary);
15 }
16 }
17
18
19 }

Save Run

http://www.skillrack.com/faces/candidate/dailychallenge.xhtml?k=DC 2/2

Das könnte Ihnen auch gefallen