Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Do character constants represent numerical values?

1332


what will be maximum number of comparisons when number of elements are given?

1899


What is the use of the function in c?

1017


How many keywords are there in c?

1074


Difference between constant pointer and pointer to a constant.

1131


What is a const pointer in c?

1126


How can you pass an array to a function by value?

1112


How do we print only part of a string in c?

1020


What is the difference between c and python?

1163


What is the difference between scanf and fscanf?

1259


Where define directive used?

1087


what are bit fields? What is the use of bit fields in a structure declaration?

2117


Explain what is meant by high-order and low-order bytes?

1044


What are the advantages of using new operator as compared to the function malloc ()?

1327


What is c definition?

1267