I need help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I need help

I need a code in c language to print this pattern ******* ** ** * * * * * * * * * * * ** ** *******

29th Nov 2019, 4:27 PM
Saba
20 Answers
+ 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.. 😃
29th Nov 2019, 4:36 PM
laura
+ 2
but I live in iran and we can’t use international credit cards
29th Nov 2019, 4:30 PM
Saba
+ 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..
29th Nov 2019, 4:32 PM
Alaska
Alaska - avatar
+ 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..
29th Nov 2019, 4:48 PM
Alaska
Alaska - avatar
+ 1
Okay..It will be 99.00$ for code😁
29th Nov 2019, 4:29 PM
Alaska
Alaska - avatar
+ 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; }
29th Nov 2019, 4:40 PM
Saba
+ 1
Salm
29th Nov 2019, 10:52 PM
Elissa Elissa
Elissa Elissa - avatar
0
i was kidding too i provide the whole code but it errored
29th Nov 2019, 4:38 PM
Saba
0
let me send my code
29th Nov 2019, 4:39 PM
Saba
0
@AnonymousGuy that's what you get for long name that can be shortened... 😛 have a good day!
29th Nov 2019, 4:43 PM
laura
0
do { Console.WriteLine("*******"); Console.WriteLine("** **"); Console.WriteLine("* * * *"); Console.WriteLine("* * *"); Console.WriteLine("** **"); Console.WriteLine("*******"); } while (true); Console.ReadKey();
30th Nov 2019, 9:38 PM
4R458
4R458 - avatar
0
DanFlamer Are you sure the way you have wrote the code will print the same pattern given above??🤔
1st Dec 2019, 1:30 PM
Alaska
Alaska - avatar
0
AnonymousGuy i just give a short type of code his can continue it
1st Dec 2019, 1:32 PM
DanFlamer
DanFlamer - avatar
0
DanFlamer I think you have not seen the replies given above..she has already given his code in one of the replies..
1st Dec 2019, 1:34 PM
Alaska
Alaska - avatar
0
Guys I'm from Iran I don't know what this app is for. Please help me
1st Dec 2019, 3:44 PM
سینا
- 1
laura You should have written my whole name atleast😂😂
29th Nov 2019, 4:39 PM
Alaska
Alaska - avatar
- 1
laura 😂😂
29th Nov 2019, 4:46 PM
Alaska
Alaska - avatar
- 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(“*”); }
1st Dec 2019, 1:27 PM
DanFlamer
DanFlamer - avatar
29th Nov 2019, 10:53 PM
Elissa Elissa
Elissa Elissa - avatar