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
Describe the difference between = and == symbols in c programming?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
I need previous papers of CSC.......plz help out by posting them.......
What is the difference between fread and fwrite function?
What is #define used for in c?
What functions are used in dynamic memory allocation in c?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
What is the explanation for modular programming?
How do you define CONSTANT in C?
Explain data types & how many data types supported by c?
What is the data segment that is followed by c?
Explain how to reverse singly link list.
What is the g value paradox?
What is c system32 taskhostw exe?
Explain the use of keyword 'register' with respect to variables.