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 the size of empty structure in c?
What library is sizeof in c?
What are dangling pointers? How are dangling pointers different from memory leaks?
In C programming, how do you insert quote characters (‘ and “) into the output screen?
What is pointers in c?
What does dm mean sexually?
How do you use a pointer to a function?
How can you tell whether a program was compiled using c versus c++?
Explain what is the purpose of "extern" keyword in a function declaration?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
What is the difference between fread buffer() and fwrite buffer()?
what is the basis for selection of arrays or pointers as data structure in a program
Is main an identifier in c?
Is it cc or c in a letter?
Give the rules for variable declaration?