24.12.19

example for nested loop program in c

#include<stdio.h>
{
int i,j;

for(i=1;i<=5;i++)
{  
     for(j=1;j<=3;j++)
        {
            printf("%d,%d\n",i,j);
         }
     }  
 }


OUTPUT
1,1
1,2
1,3
2,1
2,2
2,3
3,1
3,2
3,3
4,1
4,2
4,3
5,1
5,2
5,3

No comments:

Post a Comment

JAVA program pattern 2

import java.util.Scanner; public class pattern3 { public static void main(String args[]) { int i,j; Scanner sc=new Scanner(System.in); Syste...