write the program for prime numbers?
Answer Posted / priyanka chauhan
// prime no series. //
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
printf("Enter the no: ");
scanf("%d",&n);
printf("\n");
for(i=1;i<=n;i++)
{
for(j=2;j<=i-1;j++)
{
if(i%j==0)
break;
}
if(j==i)
printf("%d ",j);
}
getch();
}
| Is This Answer Correct ? | 173 Yes | 84 No |
Post New Answer View All Answers
What is else if ladder?
Write a program to print "hello world" without using a semicolon?
What is exit() function?
Explain what is the heap?
What is extern c used for?
What is %d used for?
How do we open a binary file in Read/Write mode in C?
explain what are actual arguments?
What is c variable?
Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant
What is a header file?
Can true be a variable name in c?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
Write a program that accept anumber in words
What are the uses of a pointer?