Write a program using two-dimensional array that lists the odd
numbers and even numbers separately in a 12 input values.
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 |
Write a program to check whether a number is prime or not using c?
What is an anonymous union and where to apply that ?
How many parameters should a function have?
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?
What is malloc calloc and realloc in c?
Write a program to print "hello world" without using a semicolon?
What is the purpose of & in scanf?
What is null character in c?
Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….
Explain Function Pointer?
What is spaghetti programming?