write a program to find the given number is prime or not
Answers were Sorted based on User's Feedback
Answer / alex
here is answer
http://www.prepjunk.com/151/program-to-find-the-given-number-is-prime-or-not
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / 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 |
int a=20; int b=30; int c=40; printf("%d%d%d"); what will be the output?
what is diffrence between string and character array?
how can we print hellow world programme without using semicolon
Can we change the value of static variable in c?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
void main() {int i=2; printf("%d%d%d",i,++i,i++); getch(); }
What is c token?
Can you define which header file to include at compile time?
Write a program to swap two numbers without using a temporary variable?
suppose there are five integers write a program to find larger among them without using if- else
What are the 5 types of inheritance in c ++?
What is cohesion in c?