Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)

Answer Posted / santhi perumal

#include<Stdio.h>
#include<conio.h>

int main()
{
int i,j, flag = 0;

for(i=2;i<=100;i++)
{
for(j=2;j<i;j++)
{
if(i != j)
{
if(i%j != 0)
continue;
else
break;
}
}
if(i == j)
printf("%d ",i);

}
}

Is This Answer Correct ?    52 Yes 38 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can I open a file so that other programs can update it at the same time?

1070


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

972


Why header file is used in c?

1041


Why is c fast?

1017


What is the ANSI C Standard?

1227


Explain how do you list files in a directory?

1028


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

1031


Is flag a keyword in c?

1117


Write a program to generate random numbers in c?

1063


i want to know the procedure of qualcomm for getting a job through offcampus

2425


write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.

2828


What is const and volatile in c?

1001


Explain about block scope in c?

1046


Difference between macros and inline functions? Can a function be forced as inline?

1223


How will you divide two numbers in a MACRO?

1086