C programme to Print 1 to 25 special pattern

 1 2 3 4 5

10 9 8 7 6

11 12 13 14 15

20 19 18 17 16

21 22 23 24 25






#include <stdio.h>


int main()

{

    int row,col,num=0,mum;

    for(row=1;row<=5;row++){

        for (col=1;col<=5;col++){

            if(row%2==0){

                num=num+5;

                mum=num;

                for(col=1;col<=5;col++){

                    printf("%d ",mum);

                    mum--;

                    

                }}

                else {

                    num++;

            printf("%d ",num);

           

                    

                     }

            

            

        } 

        printf("\n");

    }


    return 0;

}


Comments

Popular posts from this blog

C Programme to find Area Of Rectangle

C programme to reverse the number