Skip to content
Snippets Groups Projects
Commit d803de26 authored by PRANAV VIKRAMAN's avatar PRANAV VIKRAMAN
Browse files

R letter pattern

parent e5338adb
No related branches found
No related tags found
No related merge requests found
R.c 0 → 100644
/*R Letter pattern
*********
* *
* *
* *
* *****
* *
* *
* *
* * */
#include <stdio.h>
int main(){
int n;
printf("Enter the limit (prefer odd number):");
scanf("%d", &n);
for(int i=1; i<=n; i++){
for(int j=1; j<=n; j++){
if((i==1&&i<=n)||(j==1&&j<=n)||(j==n&&i<=(n+1)/2)||(i==(n+1)/2&&j>=(n+1)/2)||(i==j&&i>(n+1)/2)){;
printf("*");
} else{
printf(" ");
}
}
printf("\n");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment