write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / siva
#include<stdio.h>
#include<conio.h>
void main()
{
int flag,x;
clrscr();
printf("1\t");
for(int i=1;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 ? | 1 Yes | 1 No |
Post New Answer View All Answers
Hai what is the different types of versions and their differences
Describe explain how arrays can be passed to a user defined function
What does the c in ctime mean?
what is different between auto and local static? why should we use local static?
Stimulate calculator using Switch-case-default statement for two numbers
How do you define CONSTANT in C?
When should the register modifier be used? Does it really help?
Can you please explain the difference between strcpy() and memcpy() function?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
What is sizeof c?
What are the types of arrays in c?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference