Answer to Question #59971 in C for kenny

Question #59971
Write a program which produces the given sequence numbers in alternate arrangement using for loop .
1,5,2,4,3,3,4,2,5,1
1
Expert's answer
2016-05-16T07:46:07-0400
#include <stdio.h>

int main()
{
for (int i = 1; i < 6; ++i)
if (i!=5)
printf("%d,%d,",i,6-i);
else
printf("%d,%d\n",i,6-i);
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS