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
Tell us two differences between new () and malloc ()?
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
What are pointers?
What are the rules for identifiers in c?
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
Is exit(status) truly equivalent to returning the same status from main?
Explain how can I convert a string to a number?
What happens if you free a pointer twice?
What is #define size in c?
Is stack a keyword in c?
What is difference between Structure and Unions?
Explain what are compound statements?
What is the general form of a C program?
What is selection sort in c?
Why we use conio h in c?