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 does a function declared as pascal do differently?
What is the method to save data in stack data structure type?
What are integer variable, floating-point variable and character variable?
What is C language ?
How can I open files mentioned on the command line, and parse option flags?
What is meant by realloc()?
Explain built-in function?
Explain goto?
What is the g value paradox?
which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +
Describe dynamic data structure in c programming language?
What is the value of c?
Why is python slower than c?
What is a const pointer in c?
What is queue in c?