Write a program using two-dimensional array that lists the odd
numbers and even numbers separately in a 12 input values.

Answer Posted / jeeva

#include<stdio.h>
#include<conio.h>
void main()
{
int a[20][20],k,n=20;
printf("enter the number of value");
scanf("%d",&n);
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}}
if(i%2==0)
{
printf("the number is even");
}
else
{
printf("the number is odd");
}}
if(j%2==0)
{
printf("the number is even");
}
else
{
printf("the number is odd");
}
k=0;
k=k+a[i][j];
printf("%d",k);
}
gerch();
}

Is This Answer Correct ?    29 Yes 43 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is the use of a semicolon (;) at the end of every program statement?

727


What is meant by initialization and how we initialize a variable?

581


write a programming in c to find the sum of all elements in an array through function.

1700


How do you use a 'Local Block'?

714


what are the different storage classes in c?

660






Where are c variables stored in memory?

592


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

578


What is static and auto variables in c?

557


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

904


Can we change the value of constant variable in c?

566


Explain the bubble sort algorithm.

636


Can we change the value of static variable in c?

556


How do I copy files?

619


What is the collection of communication lines and routers called?

604


difference between Low, Middle, High Level languages in c ?

1626