write the program for prime numbers?
Answer Posted / adhiyamaan
#include<stdio.h>
#include<conio.h>
{
int num,i;
printf("enter the number:");
scanf("%d",&num);
for(i=2;i<=num-1;i++)
{
if(num%i==0)
{
printf("NOT PRIME");
break;
}
}
if(i==num)
{
printf("PRIME");
}
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if
How can a number be converted to a string?
Explain what are run-time errors?
Why do some versions of toupper act strangely if given an upper-case letter?
How can you increase the size of a dynamically allocated array?
What is array of structure in c?
How a string is stored in c?
What is merge sort in c?
When should the const modifier be used?
using only #include
Do pointers take up memory?
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
What are types of structure?
What is the acronym for ansi?
Why is C language being considered a middle level language?