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 |
What is c programming structure?
Why is void main used?
Is it possible to create recycle bin in mobiles?
What do you mean by dynamic memory allocation in c? What functions are used?
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2)
What is structure packing ?
An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode
Find occurence of a character in a sting.
Write a program with dynamically allocation of variable.
if we take a number as a char then can we manipulate(add, subtract) on this number
How to receive strings with spaces in scanf()
Are bit fields portable?