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...

I have an array of 100 elements, each of which is a random
integer. I want to know which of the elements:
a) are multiples of 2
b) are multiples of 2 AND 5
c) have a remainder of 3 when divided by 7

Answer Posted / ruchi

#include<stdio.h>
#include<conio.h>
void main()
{
int num[100],n,i;
clrscr();
printf("\nEnter the number of elements ");
scanf("%d",&n);
printf("\nEnter the number ");
for(i=0;i<n;i++)
{
scanf("%d",&num[i]);
}
for(i=0;i<n;i++)
{
if(num[i]%2==0)
{
printf("\nThe Number %d is multiple of 2 ",num[i]);
}
if((num[i]%2==0)&&(num[i]%5==0))
{
printf("\nThe Nubmer %d is the multiple of both 2 and 5
",num[i]);
}
if(num[i]%7==3)
{
printf("\nThe number %d has remainder 7 ",num[i]);
}
}
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where are c variables stored in memory?

1027


how to capitalise first letter of each word in a given string?

1875


In c programming language, how many parameters can be passed to a function ?

1056


Why clrscr is used after variable declaration?

1625


What is structure padding and packing in c?

1008


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2011


How does normalization of huge pointer works?

1104


Is anything faster than c?

971


What does a function declared as pascal do differently?

1045


Write a program which returns the first non repetitive character in the string?

1059


What is meant by type specifiers?

1084


How to throw some light on the b tree?

1023


What does void main return?

1074


A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(

2205


What is meant by realloc()?

1086