write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / bobby shankar
///Prime Number between 1 to n number
int Prime(int init ,int final)
{
int i;
while(init <= final)
{
i=2;
while(i<init)
{
if(init%i==0)
break;
i++;
}
if(i==init)
printf("\n %d is Prime number",init);
init++;
}
}
int main()
{
int inital,final;
printf("\n Enter your Range followed by space separater
e.g 3 30 : ");
scanf("%d %d",&inital,&final);
Prime(inital,final);
getch();
return 1;
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
List out few of the applications that make use of Multilinked Structures?
Array is an lvalue or not?
What is the difference between constant pointer and constant variable?
What are the types of data files?
When should the volatile modifier be used?
What is %g in c?
Explain what does the format %10.2 mean when included in a printf statement?
Where we use clrscr in c?
what are # pragma staments?
Do array subscripts always start with zero?
What are loops in c?
When should a type cast be used?
How can I implement a delay, or time a users response, with sub-second resolution?
What are qualifiers in c?
What is volatile variable in c?