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
What are identifiers c?
What is the description for syntax errors?
What is a wrapper function in c?
How many keywords are there in c?
What are pointers?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
What is atoi and atof in c?
in linking some of os executables are linking name some of them
Is c object oriented?
What is the difference between single charater constant and string constant?
#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }
In c programming language, how many parameters can be passed to a function ?
How can you find the day of the week given the date?
write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a
What are the valid places to have keyword “break”?