C : Program for printing asterisk in plus shape

--

Program :

//c program for printing asterisk in plus shape

#include<stdio.h>

int main()
{
for(int i=1; i<=5; i++)
{
for(int j=1; j<=5; j++)
{
if(j==3 || i==3)
{
printf("* ");
}
else
{
printf(" ");
}
}
printf("\n");
}

return 0;
}


Output :

--

--

Programmer Portfolio
Programmer Portfolio

Written by Programmer Portfolio

Code enthusiast. Learning, practicing, and sharing my journey through various programming languages, one code at a time. 🚀💻

No responses yet