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 / 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 |
What compilation do?
7 Answers Geometric Software, Infosys,
how to devloped c lenguege?
Write a program that will read the input of any number of digits n in a row of shafh showing the breakdown of the printing and printing figures by the recursive function.
Apart from dennis ritchie who the other person who contributed in design of c language.
What is the difference between declaring a variable by constant keyword and #define ing that variable?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
How many header files are in c?
Explain the advantages of using macro in c language?
Write the control statements in C language
Hi Every one...........I have been selected for the SBI Clerk. But i m one month Pregnanat. So anyone please suggest me, is they take any objection on my joining .
4 Answers State Bank Of India SBI,
write a program of palindrome(madam=madam) using pointer?
which operator having lowest precedence?? a.)+ b.)++ c.)= d.)%