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
What is the use of header files?
What is a function simple definition?
How can you call a function, given its name as a string?
What are high level languages like C and FORTRAN also known as?
How are variables declared in c?
What are the two types of functions in c?
What is the purpose of clrscr () printf () and getch ()?
What is volatile variable how do you declare it?
Write a code to generate a series where the next element is the sum of last k terms.
How do we open a binary file in Read/Write mode in C?
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
What are the types of type specifiers?
while initialization of array why we use a[][2] why not a[2][]...?
What is the difference between fread and fwrite function?
What are the modifiers available in c programming language?