write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / jigar
#include<stdio.h>
#include<conio.h>
void main()
{
int a,n,f;
clrscr();
for(n=1;n<=100;n++)
{
f=0;
for(a=2;a<n;a++)
{
if(n%a==0)
{
f=1;
break;
}
}
if(f==0)
printf("%d",n);
}
getch();
}
// JIGAR SHOBHANA (ANIDA VACHHARA-GONDAL)
| Is This Answer Correct ? | 4 Yes | 7 No |
Post New Answer View All Answers
Between macros and functions,which is better to use and why?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
What language is lisp written in?
Can the size of an array be declared at runtime?
Is calloc better than malloc?
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
Should I learn c before c++?
find the sum of two matrices and WAP for it.
about c language
What is LINKED LIST? How can you access the last element in a linked list?
Can you write a programmer for FACTORIAL using recursion?
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
What is the purpose of main() function?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above