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



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

Answer / 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

More C Interview Questions

Write a program to check whether a number is prime or not using c?

0 Answers  


What is an anonymous union and where to apply that ?

3 Answers   HP,


How many parameters should a function have?

0 Answers  


main() { int i = 1; int num[] = {1,2,3,4}; num[i] = i++; printf("%d", num[i]); } what will be the output? }

22 Answers   NDS, TCS,


What is the use of function overloading in C?

0 Answers   Ittiam Systems,


What is malloc calloc and realloc in c?

0 Answers  


Write a program to print "hello world" without using a semicolon?

0 Answers  


What is the purpose of & in scanf?

0 Answers  


What is null character in c?

0 Answers  


Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….

1 Answers  


Explain Function Pointer?

0 Answers   Wipro,


What is spaghetti programming?

0 Answers  


Categories