write the program for prime numbers?
Answer Posted / paps
#include<stdio.h>
void main()
{
int a=1,i,j,b,n;
printf("enter the range\n");
scanf("%d",&n);
printf("prime number series between 1 to %d:n");
printf("%d",a);
while(i<=n)
{
for(j=2;j<i;j++)
{
b=i%j;
if(b==0)
break;
}
if(i==j)
printf("%d",i);
i++;
}
getch();
}
| Is This Answer Correct ? | 8 Yes | 4 No |
Post New Answer View All Answers
What is the use of typedef in structure in c?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
What is c system32 taskhostw exe?
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
What is enumerated data type in c?
What is the data segment that is followed by c?
Explain #pragma statements.
What language is c written?
Write the Program to reverse a string using pointers.
Describe the steps to insert data into a singly linked list.
What are the types of unary operators?
What are pointers?
What is a ternary operator in c?
What is function prototype in c with example?
What is string constants?