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
What are terms in math?
What is a char c?
Explain what is #line used for?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
Can we declare a function inside a function in c?
I have a varargs function which accepts a float parameter?
What are the 4 types of unions?
Explain the advantages and disadvantages of macros.
If you know then define #pragma?
Explain what standard functions are available to manipulate strings?
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
Explain how do you determine a file’s attributes?
What is the purpose of the statement: strcat (S2, S1)?
When c language was developed?
Write a program to print all permutations of a given string.