how i m write c program 1.check prime number 2.prime number
series
Answer Posted / sulthan
#include<stdio.h>
void main()
{
int a,i,n=0;
printf("\nEnter the Number");
scanf("%d",&a);
for(i=1;i<=a;i++)
if(a%i==0)
n++;
if(n=2)
printf("Prime")
else
printf("NOT Prime");
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What are the advantages of external class?
What are the differences between new and malloc in C?
How can I make it pause before closing the program output window?
Write a program to check whether a number is prime or not using c?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
What are the application of c?
explain what is fifo?
What is static memory allocation? Explain
What's a good way to check for "close enough" floating-point equality?
Tell me is null always defined as 0(zero)?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
Why can arithmetic operations not be performed on void pointers?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
What does sizeof int return?
What are the uses of null pointers?