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
Explain what is the use of a semicolon (;) at the end of every program statement?
What is meant by initialization and how we initialize a variable?
write a programming in c to find the sum of all elements in an array through function.
How do you use a 'Local Block'?
what are the different storage classes in c?
Where are c variables stored in memory?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
What is static and auto variables in c?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
Can we change the value of constant variable in c?
Explain the bubble sort algorithm.
Can we change the value of static variable in c?
How do I copy files?
What is the collection of communication lines and routers called?
difference between Low, Middle, High Level languages in c ?