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 how do I determine whether a character is numeric, alphabetic, and so on?
What type of function is main ()?
What is pointer & why it is used?
What does int main () mean?
write a program to rearrange the array such way that all even elements should come first and next come odd
Explain void pointer?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
Explain why can’t constant values be used to define an array’s initial size?
What does void main return?
What is %d used for?
Can a void pointer point to a function?
How are 16- and 32-bit numbers stored?
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above