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 arrays can be passed to a user defined function

0 Answers  


write the function int countchtr(char string[],int ch);which returns the number of timesthe character ch appears in the string. for example the call countchtr("she lives in Newyork",'e') would return 3.

6 Answers  


give an example of type casting by a simple c program

2 Answers   TCS,


write a c program to find the probability of random numbers between 1-1000

0 Answers   ADS,


struct node { int *a; char *b; char array[12]; }; struct node m,*n; assign the value in *a,*b,char array[12]

3 Answers  






Explain what is the difference between null and nul?

0 Answers  


Derive the complexity expression for AVL tree?

1 Answers  


What is size of union in c?

0 Answers  


Why c language is called c?

0 Answers  


How do you list a file’s date and time?

0 Answers  


write the program to find multiplication of 2-D matrix??????????

1 Answers  


What are the __date__ and __time__ preprocessor commands?

0 Answers  


Categories