write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / shailesh singh
#include<stdio.h>
#include<conio.h>
void main()
{
int flag,x;
clrscr();
printf("2\t");
for(int i=3;i<=100;i++)
{
flag=0;
for(x=2;x<=i;x++)
{
if(i%x==0)
{
flag=1;
break;
}
else
continue;
}
if(i==x)
printf("%d\t",i);
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Can you write the function prototype, definition and mention the other requirements.
What is break in c?
Explain that why C is procedural?
How would you obtain the current time and difference between two times?
What is the difference between functions abs() and fabs()?
How pointers are declared?
When the macros gets expanded?
What are the types of data structures in c?
What is register variable in c language?
Explain how can I pad a string to a known length?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
How do we open a binary file in Read/Write mode in C?
What is the use of extern in c?
Describe dynamic data structure in c programming language?
Write the control statements in C language