wap to print in c
13579
35791
57913
79135
91357
Answers
Answered by
4
The given problem is solved using language - C.
#include <stdio.h>
int main() {
int n=5,i,j,c;
printf("Here is your pattern!!!\n");
for(i=1;i<=2*n-1;i+=2){
for(j=1,c=i;j<=n;j++,c+=2)
printf("%d",c%10);
printf("\n");
}
return 0;
}
Here, I have assumed that the number of rows is fixed. You can also take 'n' as input from the user.
Here is your pattern!!!
13579
35791
57913
79135
91357
See attachment for verification.
Attachments:
Similar questions