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
Are negative numbers true in c?
How can you access memory located at a certain address?
What is character set?
How do I use void main?
State the difference between realloc and free.
What is storage class?
Why is struct padding needed?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What is typedef?
int far *near * p; means
How many levels of pointers can you have?
What is hashing in c?
What is assignment operator?
How can I find the modification date of a file?
How pointer is different from array?