c program to input values in a table(using 2D array) and print odd numbers from them
Answer Posted / ashu
void main()
{
int a[10][10],i,j,n;
clrscr();
printf("enter the no. of elements:");
scanf("%d",&n);
printf("Enter the elements:");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("Odd no.:");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(a[i][j]%2==0)
{
printf(" ");
}
else
{
printf(" %d",a[i][j]);
}
}
}
getch();
}
Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
What is the difference between pure virtual function and virtual function?
What is default value of global variable in c?
Why do we use namespace feature?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
What is "Duff's Device"?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
how do you execute a c program in unix.
When a c file is executed there are many files that are automatically opened what are they files?
What is header file in c?
Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?
Is it possible to initialize a variable at the time it was declared?
Explain high-order and low-order bytes.
formula to convert 2500mmh2o into m3/hr
What are multidimensional arrays?
Why is structure important for a child?