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 / shabeer v c

def shaf(n):
l=range(3,n+1,2)
mi=n
i=0
r=0
print l
while l[i]<n-1:

for j in range(2,l[i]):
if l[i]%j==0:
r=5
if r==0:
print l[i]


r=0
i=i+1


if __name__ == "__main__":
print "prime numbers from 2 to <101 "
shaf(100)

Is This Answer Correct ?    21 Yes 46 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are # preprocessor operator in c?

1126


What is meant by int main ()?

1218


Why is it usually a bad idea to use gets()? Suggest a workaround.

1804


What are integer variable, floating-point variable and character variable?

1267


Explain what are reserved words?

1115


Is it possible to pass an entire structure to functions?

1006


What are c preprocessors?

1209


Explain the term printf() and scanf() used in c language?

1059


Explain two-dimensional array.

1089


What is a global variable in c?

1025


What oops means?

1010


What is dynamic variable in c?

1042


What is a protocol in c?

1017


What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1145


write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34

2200