look and say program

+3 kim arrray · February 7, 2015
I have to write a C program to do 15 lines automatically without requesting input from the user. The pattern starts with 1 and takes line 1: 1="one 1"=11
line 2: 11="two 1"=21
line 3: 21="one 2 one 1" =1211
line 4: 1211="one 1 one 2 two 1"=111221
the pattern is suppose to keep going for 15 lines, the output is suppose to look like this:
1
11
21
1211
111221
down to 15.
I am completely lost on how to do this.
we only learned printf, scanf, while, if then else, variables, and expressions.
i have been trying for days to figure this out.

thanks in advance for any help.
I need help before 6PM today. :(

Post a Reply

Replies

Oldest  Newest  Rating
0 J show · February 8, 2015
It look like a for or while loop but i dont see the pattern? It's too late now though:( did you figure it out?
  • 1

C

107,157 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator