write the program for prime numbers?
Answer Posted / ashok
void main()
{
int i,n;
clrscr();
printf("\nEnter the range:");
scanf("%d",&n)
printf("Prime numbers are:");
for(i=1;i<=n;i++)
{
if(i==2 || i==3 || i==5 || i==7)
printf("%d ",i);
if(i%2!=0 && i%3!=0 && i%5!=0 && i%7!=0)
printf("%d ",i);
}
getch();
}
| Is This Answer Correct ? | 7 Yes | 8 No |
Post New Answer View All Answers
what is the basis for selection of arrays or pointers as data structure in a program
Why is void main used?
What is action and transformation in spark?
Function calling procedures? and their differences? Why should one go for Call by Reference?
How is pointer initialized in c?
What is pass by reference in functions?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
What do you mean by command line argument?
Can we initialize extern variable in c?
How can I find out how much free space is available on disk?
What is volatile variable in c with example?
What is a sequential access file?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
Why are all header files not declared in every c program?
What is queue in c?