Answer Posted / waleed
#include<iostream.h>
#include<conio.h>
int prime(int);
void main()
{
clrscr();
int num,x;
cout<<"Enter the no.=";
cin>>num;
x=prime(num);
if(x==1)
{
cout<<"Number is prime";
}
else
{
cout<<"Number is not prime";
}
getch();
}
int prime(int x)
{
int k;
for(int i=2;i<x;i++)
{
if (x%i==0)
{
k=2;
}
}
if (k==2)
return 0;
else
return 1;
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Which is not a valid keyword a) public b) protected c) guarded
What is an undefined reference/unresolved external symbol error and how do I fix it?
What does flush do?
What does iomanip mean in c++?
What is exception handling? Does c++ support exception handling?
When should we use multiple inheritance?
what is software cycle? What is a mission critical system ? What is the important aspect of a real-time system ? Explain the difference between microkernel and macro kernel. Give an example of microkernel.Why paging is used ? Which is the best page replacement algo and Why ? What is software life cycle ? How much time is spent usually in each phases and why Which one do U want to work if selected in Honeywell ? Which are the different types of testing ? What is a distributed system ? Some questions about CSP. Which languages do U know ? What are the differences between Pascal and C. questions from Compiler construction and Lisp. Which are the different computer architecture? What is the requirement in MIMD ? What is the difference between RISC and CISC processors ? Difference between loosely coupled and tightly coupled systems ? What is an open system?
What is an incomplete type in c++?
Can member data be public?
Differentiate between declaration and definition.
What do nonglobal variables default to a) auto b) register c) static
What are maps in c++?
What is auto type c++?
What are the five basic elements of a c++ program?
Describe new operator?