#include<iostream.h>
#include<conio.h>
void prime(int n)
{
clrscr();
int num;
cout<<"enter the numbers"<<endl;
cin>>num;
prime(num);
getch();
}
void prime(int n)
{
int prime=1,i;
for(i=2;i<=n/2;i++)
if(n%i==1)
prime=0;
if(prime==1)
cout<<"the number"<<n>>"is prime";
else
cout<<"the number"<<n<<"is not prime";
}
write a c++program by using if statement to read a number and check whether it is positive or negative
write a program in C to check whether a given number is apalindrome or not
8086 assembly language program to check wether given number is perfect or not
Going through a program on paper to check whether it has errors.
45
To write a C program to determine if something is odd or even you need to be a programmer. To write a program in C is complicate and only done by programmers.
The program is here guys.......... //Finding whether the given number is perfect or not //Starts here #include<stdio.h> void main() { int i=1,temp=0,number; scanf("%d",&number); while(i<=number/2){ if(number%i==0) temp+=i; i++; } if(temp==number) printf("Its a perfect number"); else printf("Its not a perfect number"); } //ends here
if it's square root is an integer, it is a square number.
Where do you get that idea? Who doesn't recognize the number 13? Better check whether Canada does, or does not, recognize this number, instead of just assuming such an improbable situation.Where do you get that idea? Who doesn't recognize the number 13? Better check whether Canada does, or does not, recognize this number, instead of just assuming such an improbable situation.Where do you get that idea? Who doesn't recognize the number 13? Better check whether Canada does, or does not, recognize this number, instead of just assuming such an improbable situation.Where do you get that idea? Who doesn't recognize the number 13? Better check whether Canada does, or does not, recognize this number, instead of just assuming such an improbable situation.
You can check each individual number, whether it is a prime number. For numbers below 100, it is enough to check whether they are divisible by 2, by 3, by 5, and by 7. If a number is divisible by none of these, it is a prime number.
Use the Exception class and type converters.
Type your answer here... i think we should first enter 1 number then check it