Answer Posted / md.irfan(rourkela)
#include<iostream.h>
#include<conio.h>
main()
{
int n,i,f=1;
cout<<"enter any no to check prime";
cin>>n;
for(i=2;i<n;i++)
{
if(n%i==0)
k=2;
}
if(k==2)
cout<<"the no is not prime"<<endl;
else
cout<<"the no is prime";
}
getch();
}
| Is This Answer Correct ? | 145 Yes | 91 No |
Post New Answer View All Answers
Can you pass an array to a function in c++?
How do you sort a sort function in c++ to sort in descending order?
Is c++ vector dynamic?
How do you decide which integer type to use?
Difference between struct and class in terms of access modifier.
Write a Program for find and replace a character in a string.
What methods can be overridden in java?
What is an adaptor class in c++?
Tell me an example where stacks are useful?
Are php strings immutable?
What is algorithm in c++ programming?
Can we overload operator in c++?
Explain class invariant.
Must accepts "Maestro Cards" Tax for bike should be less than 15 Total number of lanes is more than 10 Must provides monthly pass Write a method: boolean isGoodTollBridge(String[] cardsAccepted, String[] tollTax, boolean hasMonthlyPass, int numberOfLanes); String[] cardsAccepted A String array of names of card types accepted for payment of toll tax, it can be null if the toll does not accept any card String[] tollTax A String array of toll tax chart (say “Train : 300â€Â,â€ÂBullCart : 10â€Â) boolean hasMonthlyPass This parameter defines whether there is any monthly pass available or not int numberOfLanes This parameter defines the number of lanes for each side
What is & in c++ function?