Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to print 2-D array using a single for loop?

Answer Posted / tknowledge05

#include<stdio.h>
#include<conio.h>
void main()
{

int a[3][3]={2,4,5,7,2,9,2,3,2};
int f=0,i;
printf("\n");
for(i=0;f!=3;i++)
{

if(i==3)
{f++;
printf("\n");
i=0;
}
printf("%d ",a[f][i]);
}




getch();
}

Is This Answer Correct ?    21 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

The statement, int(*x[]) () what does in indicate?

1143


Is null valid for pointers to functions?

1164


What is hash table in c?

1017


How can I read in an object file and jump to locations in it?

1025


what are enumerations in C

1158


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

1252


What is ponter?

1265


Can true be a variable name in c?

1034


What does the error 'Null Pointer Assignment' mean and what causes this error?

1211


How main function is called in c?

1121


What is your stream meaning?

1226


Is it possible to initialize a variable at the time it was declared?

1214


What is the meaning of ?

1034


How do we declare variables in c?

1057


What are data structures in c and how to use them?

1164