write a program to find the given number is prime or not
Answer Posted / rabindra nath das
#include<stdio.h>
#include<conio.h>
void main()
int n,k,fl=0,r;
clrscr();
printf("\n Enter the number==>>");
scanf("%d",&d);
for(k=2;k<=n/2 && fl==0;k++)
{
r=n%k;
if(r==0);
fl=1;
}
if(fl==0)
printf("\n %d is a prime number",n);
else
printf("\n %d is not prime number",n);
getch();
}
| Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
Explain what are multibyte characters?
What is an example of structure?
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
What is the difference between formatted&unformatted i/o functions?
C program to find all possible outcomes of a dice?
How is a structure member accessed?
How can I use a preprocessorif expression to ?
What is spaghetti programming?
Do you know the use of 'auto' keyword?
What are keywords c?
In C language what is a 'dangling pointer'?
What are comments and how do you insert it in a C program?
What is register variable in c language?
How is pointer initialized in c?