Computer Science, asked by vojartnepal, 2 months ago

wap to print in c
13579
35791
57913
79135
91357

Answers

Answered by anindyaadhikari13
4

\texttt{\textsf{\large{\underline{Solution}:}}}

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.

\texttt{\textsf{\large{\underline{The O{u}tput}:}}}

Here is your pattern!!!

13579

35791

57913

79135

91357

See attachment for verification.

Attachments:
Similar questions