+ 2
I need help
I need a code in c language to print this pattern ******* ** ** * * * * * * * * * * * ** ** *******
20 Respostas
+ 3
well you could use the printf() command for each line... but I suspect there is some sort of looping that is needed.
like AnonymousGuy said above... try to figure it out... still have issues..the post the code.. 😃
+ 2
but I live in iran and we can’t use international credit cards
+ 2
😂😂I was just kidding dude!!
Seriously, we cannot do your homeworks or projects..you make the logic, execute it, if it is giving error then we will surely help you but we can't provide whole code..
+ 2
Saba
1. Check brackets after two for loops(i guess it by mistake)
2. And there are bugs in conditions of if..kindly check it again..I would suggest take a pen and paper and trace the program on your own..you will definitely find the error..
+ 1
Okay..It will be 99.00$ for code😁
+ 1
#include <conio.h>
#include <stdio.h>
int main()
{
int i,n,j;
printf("enter a number");
scanf("%d",&n);
for (i=0;i<n;i++)
{
for(j=0;j<n;j++)
if(i==0 || j==0 || i==n-1 || j==n-1 || j+i==n-1)
printf("*");
else
printf(" ");
return 0;
}
+ 1
Salm
0
i was kidding too i provide the whole code but it errored
0
let me send my code
0
@AnonymousGuy that's what you get for long name that can be shortened... 😛 have a good day!
0
do {
Console.WriteLine("*******"); Console.WriteLine("** **");
Console.WriteLine("* * * *"); Console.WriteLine("* * *"); Console.WriteLine("** **"); Console.WriteLine("*******");
}
while (true);
Console.ReadKey();
0
DanFlamer
Are you sure the way you have wrote the code will print the same pattern given above??🤔
0
AnonymousGuy
i just give a short type of code his can continue it
0
DanFlamer
I think you have not seen the replies given above..she has already given his code in one of the replies..
0
Guys I'm from Iran I don't know what this app is for. Please help me
- 1
laura
You should have written my whole name atleast😂😂
- 1
laura 😂😂
- 1
Saba
saba listen to me we are from same country 😃
if u want to print that u can use ‘for’
like:
c#:
for(int a = 1; a <= 10; a++ ){
console.writeline(“*”);
}
c:
for(int a = 1; a <= 10; a++){
printf(“*”);
}