c program to input values in a table(using 2D array) and print odd numbers from them
Answer Posted / ashu
void main()
{
int a[10][10],i,j,n;
clrscr();
printf("enter the no. of elements:");
scanf("%d",&n);
printf("Enter the elements:");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("Odd no.:");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(a[i][j]%2==0)
{
printf(" ");
}
else
{
printf(" %d",a[i][j]);
}
}
}
getch();
}
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
What is pointers in c with example?
What does a function declared as pascal do differently?
Where static variables are stored in c?
Describe explain how arrays can be passed to a user defined function
What is meant by inheritance?
Difference between MAC vs. IP Addressing
diff between exptected result and requirement?
What are the types of functions in c?
What does do in c?
What is the difference between formatted&unformatted i/o functions?
Why c is called top down?
write a program to find the given number is prime or not
Write a program to check prime number in c programming?
Explain two-dimensional array.
Is main a keyword in c?