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

Are negative numbers true in c?

602


How can you access memory located at a certain address?

670


What is character set?

687


How do I use void main?

635


State the difference between realloc and free.

640






What is storage class?

657


Why is struct padding needed?

635


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

651


What is typedef?

681


int far *near * p; means

3125


How many levels of pointers can you have?

707


What is hashing in c?

646


What is assignment operator?

630


How can I find the modification date of a file?

708


How pointer is different from array?

585