Home   Easy-Code    Forum  Updater 
Twitter Facebook



Program to read 9 elements and print them in 3*3 matrix form using c

Critics Rating:

Users Rating:

/* PROGRAM TO READ 9 ELEMENTS AND PRINT THEM IN 3*3 MATRIX FORM */

#include <stdio.h>

main()

{

int a[9],c=0;

register int i;

clrscr();

printf("ENTER 9 ELEMENTS\n");

for (i=0;i<9;i++)

scanf("%d",&a[i]);

printf("THE ELEMENTS IN 3*3 MATRIX FORM IS\n");

for (i=0;i<9;i++)

{

printf("%2d",a[i]);

c++;

if (c%3==0)

printf("\n");

}

getch();

}







Courtesy, Source, References & Regards: Kishore AVGK

While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright@2009-2011 by KuGuNi.com. All Rights Reserved.