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
What are dangling pointers? How are dangling pointers different from memory leaks?
In C, What is the #line used for?
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 are the different types of control structures?
Write the Program to reverse a string using pointers.
What is void pointers in c?
Apart from dennis ritchie who the other person who contributed in design of c language.
What Is The Difference Between Null And Void Pointer?
What is malloc and calloc?
Why c is called a mid level programming language?
Explain what is a 'locale'?
What is actual argument?
What is the use of volatile?
What is a spanning Tree?
How will you print TATA alone from TATA POWER using string copy and concate commands in C?