write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / satwant singh
#include<stdio.h>
#include<conio.h>
void main()
{
long int a,b,i;
clrscr();
printf("enter start no");
scanf("%ld",&a) ;
printf("enter last no");
scanf("%ld",&b);
for(i=a;i<=b;i++)
{
if((i%2==0)||(i%3==0)||(i%5==0)||(i%7==0))
{
//printf("not prime==%ld",i);
}
else
printf("its prime==%ld\n",i);
}
getch();
}
Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
When should the const modifier be used?
What is 2 d array in c?
What is the difference between malloc() and calloc() function in c language?
What is structure packing in c?
Which is best book for data structures in c?
What are dangling pointers? How are dangling pointers different from memory leaks?
What is a class c rental property?
What does d mean?
Why do we use return in c?
Explain how do you determine whether to use a stream function or a low-level function?
What is strcmp in c?
Why is structure padding done in c?
What is p in text message?
What is #include stdio h and #include conio h?
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above