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
Which one would you prefer - a macro or a function?
What does %d do in c?
Explain main function in c?
What are the 4 types of organizational structures?
What are the usage of pointer in c?
What is variable initialization and why is it important?
What is the difference between procedural and functional programming?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
How to declare pointer variables?
What do you mean by a sequential access file?
What is difference between static and global variable in c?
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..
How does normalization of huge pointer works?
What is string concatenation in c?
how many key words availabel in c a) 28 b) 31 c) 32