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
Do character constants represent numerical values?
what will be maximum number of comparisons when number of elements are given?
What is the use of the function in c?
How many keywords are there in c?
Difference between constant pointer and pointer to a constant.
What is a const pointer in c?
How can you pass an array to a function by value?
How do we print only part of a string in c?
What is the difference between c and python?
What is the difference between scanf and fscanf?
Where define directive used?
what are bit fields? What is the use of bit fields in a structure declaration?
Explain what is meant by high-order and low-order bytes?
What are the advantages of using new operator as compared to the function malloc ()?
What is c definition?