how i m write c program 1.check prime number 2.prime number
series



how i m write c program 1.check prime number 2.prime number series..

Answer / 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

More C Interview Questions

how to find anagram without using string functions using only loops in c programming

0 Answers  


input any 4 digit number and find the difference of all the digits?

3 Answers   Google,


Why cann't whole array can be passed to function as value.

1 Answers  


write a program whose output will be- 1 12 123 1234

10 Answers  


Do you know what are bitwise shift operators in c programming?

0 Answers  


Who had beaten up hooligan "CHAKULI" in his early college days?

1 Answers  


Is c still used?

0 Answers  


How do you declare a variable that will hold string values?

0 Answers  


What is a static variable in c?

0 Answers  


Why malloc is faster than calloc?

0 Answers  


How do we swap or interchange any 2 numbers without using Temporary variable...Anybody can pls answer it.. Thanks in Advance

8 Answers  


what is the output? #define fun(a,b,t) (g ##t=(a),(a)=(b),(b)=g##t) float gfloat; main() { float a=1.12,b=3.14; fun (a,b,float); printf("na=%4.2f,b=%4.2f",a,b); } A)Error in Defining Macro B)a=1.12,b=3.14 C)a=3.14,b=1.12 D)None of the Above

3 Answers   Accenture, Infosys, Wipro,


Categories