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 'lex' does?
what is the structure pointer?
What is the use of sizeof () in c?
Explain can the sizeof operator be used to tell the size of an array passed to a function?
How do we declare variables in c?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
What is a void pointer? When is a void pointer used?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
Who developed c language and when?
What does the error 'Null Pointer Assignment' mean and what causes this error?
Can you pass an entire structure to functions?
What do you mean by keywords in c?
What is meant by realloc()?
Compare array data type to pointer data type