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

Difference between null pointer and dangling pointer?

7 Answers   GE, Wipro,


any "C" function by default returns an a) int value b) float value c) char value d) a & b

0 Answers  


What are different types of pointers?

0 Answers  


What is sparse file?

1 Answers  


WHAT IS FLOAT?

3 Answers  






why r u join this company? give solid resons.

16 Answers   IBM, Infosys, TCS,


Which programming language is best for getting job 2020?

0 Answers  


Differentiate between ordinary variable and pointer in c.

0 Answers  


i got 75% in all semester am i eligible for your company

0 Answers   Infosys,


What is meant by inheritance?

0 Answers  


What kind of sorting is this? SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort

3 Answers   Accenture,


Given an array of characters, how would you reverse it? How would you reverse it without using indexing in the array?

1 Answers   Microsoft,


Categories