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 |
Write a c code segment using a for loop that calculates and prints the sum of the even integers from 2 to 30, inclusive?
Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should be 4.
c program for searching a student details among 10 student details
Can we replace the struct function in tree syntax with a union?
What is a null string in c?
What is strcpy() function?
write a function that accepts an array A with n elements and array B with n-1 elements. Find the missing one in array B,with an optimized manner?
Explain what does a function declared as pascal do differently?
Explain output of printf("Hello World"-'A'+'B'); ?
What is false about the following A compound statement is a.A set of simple statments b.Demarcated on either side by curly brackets c.Can be used in place of simple statement d.A C function is not a compound statement.
What are the data types present in c?
who is the father of C Language?
20 Answers CTS, UST,