C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Created by Swapnil More
/*
This code takes a number "n " from user and prints "+" pattern if number of row is even and prints "*" if number of row is odd.
Example:
Input: 6
Output:
1*
2++
3***
4++++
5*****
6++++++
*/
// Challenge thread is in the comments section
#include <stdio.h>
int main() {
int i,j,n;
printf("Enter a number: ");
scanf("%d",&n);
printf("%d\n",n);
for(i=1;i<=n;i++){
printf("%d",i);
if(i%2==0){
for(j=1;j<=i;j++){
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run