write the program for prime numbers?
Answer Posted / mudassir shakil
using System;
class Prime_Checker
{
int i;
int counter=0;
int n;
Console.WriteLine("Enter the number");
n=int.Parse(Console.ReadLine());
for(i=2;i<=n;i++)
{
if(n%i==0)
{
counter=1;
}
if(counter=0)
{
Console.WriteLine("No is prime");
}
else
{
Console.WriteLine("No is not prime");
}
}
}
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
How do you convert strings to numbers in C?
what is the syallabus of computer science students in group- 1?
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
Why c is called procedure oriented language?
Explain the difference between malloc() and calloc() function?
what is use of malloc and calloc?
Explain enumerated types in c language?
Why c is procedure oriented?
Tell me what is null pointer in c?
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
How many levels of indirection in pointers can you have in a single declaration?
What is the benefit of using const for declaring constants?
Tell me what are bitwise shift operators?
Between macros and functions,which is better to use and why?