write the program for prime numbers?
Answer Posted / harpreet dhillon
#include<stdio.h> \\harpreetdhillon7@gmail.com
#include<conio.h>
void main()
{
int i,n;
clrscr();
printf("enter any number which you want to check");
scanf("%d",&n);
for(i=2;i<=n-1;i++)
{
if(n%i==0)
{
printf("not a prime number\n");
break;
}
else
{
printf("prime number\n");
break;
}
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What are enumerated types?
What are the different types of errors?
Explain what is gets() function?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
Whats s or c mean?
What is the symbol indicated the c-preprocessor?
What is volatile keyword in c?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Explain how do you list a file’s date and time?
Explain what are multidimensional arrays?
Is c object oriented?
pierrot's divisor program using c or c++ code
Why is c not oop?
1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.