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
Define circular linked list.
Explain what are compound statements?
What does the c preprocessor do?
What is #include stdio h?
Ow can I insert or delete a line (or record) in the middle of a file?
What is pivot in c?
Write a program to reverse a string.
how many errors in c explain deply
What are the __date__ and __time__ preprocessor commands?
Do pointers store the address of value or the actual value of a variable?
What is the size of a union variable?
What are pointers in C? Give an example where to illustrate their significance.
What is a union?
Explain how can you determine the size of an allocated portion of memory?
Explain the process of converting a Tree into a Binary Tree.