write the program for prime numbers?
Answer Posted / shubhanshu pandey
main()
{
int a,c=0,i,n;
printf("enter the number to be checked");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
a=n%i;
if(a=0)
{
c=c+1;
}
}
if (c=2)
{ printf("the given number is prime"); }
else
printf("the given number is not prime");
}
Is This Answer Correct ? | 7 Yes | 4 No |
Post New Answer View All Answers
what is different between auto and local static? why should we use local static?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
What is structure data type in c?
What is the difference between Printf(..) and sprint(...) ?
Explain what is meant by high-order and low-order bytes?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
What is unsigned int in c?
Why doesnt the call scanf work?
write a c program in such a way that if we enter the today date the output should be next day's date.
Why c is procedure oriented?
Tell me the use of bit field in c language?
What is dynamic memory allocation?
What is memcpy() function?
Is fortran still used today?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor