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

write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2415


Explain how to reverse singly link list.

612


Explain 'far' and 'near' pointers in c.

710


Does sprintf put null character?

607


Why c is procedure oriented?

578






How would you rename a function in C?

625


Why is a semicolon (;) put at the end of every program statement?

632


What are the 4 types of unions?

615


What is an example of structure?

591


Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?

986


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1256


What is data type long in c?

627


Does c have function or method?

596


What is c definition?

754


Write a program to print factorial of given number using recursion?

607