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
Is file a keyword in c?
Explain how can I read and write comma-delimited text?
Explain union. What are its advantages?
Explain about C function prototype?
Is exit(status) truly equivalent to returning the same status from main?
Can variables be declared anywhere in c?
What are the different types of errors?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
Explain how can I make sure that my program is the only one accessing a file?
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
What is the difference between call by value and call by reference in c?
What are pointers? What are stacks and queues?
What are the salient features of c languages?
What are linked lists in c?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?