write the program for prime numbers?
Answer Posted / paartha
include<stdio.h>
#include<conio.h>
void main()
{
int a,i , b,flag=0,no;
clrscr();
for(no=2;no<100;no++)
{
for(i=2;i<no;i++)
{
b=no%i;
if(b==0)
{
flag=1;
break;
}
else
{
flag=0;
}
}
if(flag!=1)
{
printf("\n%d",no);
}
}
getch();
}
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
Why we use stdio h in c?
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.
How are portions of a program disabled in demo versions?
How to declare pointer variables?
Explain how are 16- and 32-bit numbers stored?
Explain how do you list files in a directory?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
Write a Program to accept different goods with the number, price and date of purchase and display them
Are c and c++ the same?
Do you know the difference between malloc() and calloc() function?
What is the need of structure in c?
Write a program to reverse a given number in c language?
Explain what happens if you free a pointer twice?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
What is abstract data structure in c?