AMARKANT KUMAR
Monday, 30 July 2012
Given "a1","b1","c1","a2","b2","c2","a3","b3","c3","a4","b4","c4","a5","b5","c5" , write a program to arrange like a1 a2 a3 a4 a5 b1 b2 b3 b4 b5 c1 c2 c3 c4 c5.........
#include <stdio.h>
int main()
{
char *str[3*5]={"a1","b1","c1","a2","b2","c2","a3","b3","c3","a4","b4","c4","a5","b5","c5"};
int n=3,i,j;
for(i=1;i<=3;i++)
{
for(j=i-1;j<15;j++)
{
printf("%s ",str[j]);
j=j+2;
}
}
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment