write a progra in c++ using class & object to find out
wheather a given no. is prim or not.
Answer Posted / rakesh ranjan
#include<conio.h>
void main()
{
int a,i;
printf("enter the number ");
scanf("%d",&a);
for(i=2;i<a;i++)
if(a%i==0)
{
printf("number is not Prime");
break;
}
if(i==a)
printf("Prime number");
getch();
}
| Is This Answer Correct ? | 16 Yes | 6 No |
Post New Answer View All Answers
What is solid in oops?
Why do we use inheritance?
What is polymorphism and types?
What is protected in oop?
Is enum a class?
How oops is better than procedural?
write a program that takes input in digits and display the result in words from 1 to 1000
What is inheritance write a program to show use of inheritance?
What is use of overloading?
What are different oops concepts?
What do you mean by variable?
What language is oop?
What is object and class in oops?
Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.
What is oops?what is its use in software engineering?