c program to input values in a table(using 2D array) and print odd numbers from them



c program to input values in a table(using 2D array) and print odd numbers from them..

Answer / 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

More C Interview Questions

Explain how can you determine the size of an allocated portion of memory?

0 Answers  


Write a c program to read a positive number and display it in words.? ex: 123=one two three help me....

2 Answers  


what is volatile in c language?

9 Answers   Cap Gemini, HCL, Honeywell, TCS, Tech Mahindra,


question-how to run a c programme.

6 Answers  


write a fuction for accepting and replacing lowercase letter to'Z' with out using inline function.

5 Answers   Temenos,






Is it possible to create recycle bin in mobiles?

2 Answers  


Explain how can I avoid the abort, retry, fail messages?

0 Answers  


What is #error and use of it?

0 Answers  


What happens if you free a pointer twice?

0 Answers  


Is c weakly typed?

0 Answers  


What is the use of define in c?

0 Answers  


ASCII stands for

1 Answers  


Categories