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
what is the syallabus of computer science students in group- 1?
What is %s and %d in c?
Is null always defined as 0(zero)?
How we can insert comments in a c program?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
Where register variables are stored in c?
what is a constant pointer in C
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
What are the advantages of union?
What are the types of arrays in c?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
Why we write conio h in c?
What is the purpose of macro in C language?
what will be maximum number of comparisons when number of elements are given?