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
Why do we use c for the speed of light?
How can you return multiple values from a function?
Explain why c is faster than c++?
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
Do array subscripts always start with zero?
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
while initialization of array why we use a[][2] why not a[2][]...?
What is a string?
What is a structure member in c?
What should malloc() do?
What functions are in conio h?
What is bin sh c?
In which language linux is written?
What are the c keywords?
What is oops c?