Rem Number which is equal to the sum of cube of its digits is said to Armstrong Number
CLS
INPUT "Enter testing number=";n
v=n
WHILE V<>0
r = v MOD 10
s=s+r^3
v=int(v/10)
WEND
IF n=s THEN
PRINT n; " is Armstrong Number"
ELSE
PRINT n; " is not Armstrong Number"
ENDIF
END
How to find 5,40,300,2000,10000 series ?
ReplyDeletePlease help !
CLS
DeleteFOR I=5 TO 1 STEP -1
PRINT I*10^P
P=P+1
NEXT I
END
CLS
DeleteN=1
FOR I=5 TO 1 STEP -1
PRINT I*N
N=N*10
NEXT I
END
#thanks :*
DeleteThanks for the answer
DeleteThis comment has been removed by the author.
DeleteCLS
DeleteINPUT "enter any number"; n
WHILE n <> 0
r = n MOD 10
s = s + r ^ 3
n = n \ 10
WEND
IF s = n THEN
PRINT "the number is armstrong "
ELSE
PRINT "the number is not armstrong"
END IF
END
what is wrong with this program plz tell me
After input u should take n=n1 and after wend
DeleteIf s=n1
You don't.
DeleteIts beyond it's capacity
CLS
DeleteB=1
FOR A=5 TO 1 STEP-1
PRINT A*B;
B=B*10
NEXT A
END
CLS
DeleteINPUT "enter any number"; n
WHILE n <> 0
r = n MOD 10
s = s + r ^ 3
n = n \ 10
WEND
IF s = n THEN
PRINT "the number is armstrong "
ELSE
PRINT "the number is not armstrong"
END IF
END
what is incorrect here plz very fast
CLS
DeleteINPUT "enter any number"; n
m=n
WHILE n <> 0
r = n MOD 10
s = s + r ^ 3
n = n \ 10
WEND
IF s = m THEN
PRINT "the number is armstrong "
ELSE
PRINT "the number is not armstrong"
END IF
END
See the difference.
how will we write a program to print the following series where N is the input:
ReplyDelete1, 3, 6, 10, 15....... N terms
CLS
DeleteINPUT "Enter the no. of terms";N
a=2
For I=1 TO N STEP a
PRINT I;
a=a+1
NEXT I
END
CLS
DeleteINPUT "Enter the no. of terms";N
a=1
for i=2 to N+1
print a,
a=a+i
next i
cls
Deleteinput "enter number of terms";n
a=1 :b=2
for i=1 to n
print a;
a=a+b
b=b+1
next i
end
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeletehow to print all armstrong no from 1 to 1000?
ReplyDeletei will post tomorrow
DeleteHOW TO FIND PRIME NUMBERS?
ReplyDeleteInput "enter a number" ; N
DeleteFor i = 1 to N
If N mod I = 0 Then f = f + 1
Next i
If f = 2 then
Print "prime"
Elseif f >2 then
Print "Composite"
Else
Print "neither prime nor composite"
End if
rem to find whether an input numbeer is prime or composite
Deletecls
input "enter a number";n
for i = 2 to (n-1)
r=n mod i
if r= 0 then
print "composite"
goto a:
end if
next i
print "prime"
a:
end
Cls:x=0
DeleteInput"enter a number ",N
For i =1 to N
If N mod i=0 then x=x+1
Next i
If i=2 then
Print N,"is prime number "
Else
Print N,"is not a prime number"
End If
End
Print Armstrong numbers from 1 to 100
ReplyDeletePrint Armstrong numbers from 1 to 100
ReplyDeleteThis comment has been removed by the author.
ReplyDeletehelp me to generates the series of
ReplyDelete55555 5555 555 55 5
cls
Deletea=55555
for i=1 to 5
print a
a=a\10
next i
end
cls
Deletea=55555
for i = 1 to 5
print a
a=(a-5)/10
next i
end
thabks
ReplyDeleteWap to check whether the number is automorphic or not. Please see if you can help
ReplyDeleteWap to check whether the number is automorphic or not. Please see if you can help
ReplyDeleteWAP to find HCF and LCM.please see if u can help me
ReplyDeleteVery informative article.Thank you author for posting this kind of article .
ReplyDeletehttp://www.wikitechy.com/view-article/c-program-to-check-armstrong-number-with-example-and-explanation
Both are really good,
Cheers,
Venkat
how to do wap to the inputted number is armstrong or not
ReplyDeleteplease help anyone
ReplyDeleteHow to show palindrome?
ReplyDeleteHow to print the pattern
ReplyDeleteKATHMANDU
ATHMAND
THMAN
HMA
M
This comment has been removed by the author.
DeleteHow to print the pattern
ReplyDeleteKATHMANDU
ATHMAND
THMAN
HMA
M
cls
ReplyDeleteA$="KATHMANDU"
c=9
For I = 1 to 5
Print mid$(A$,I,c)
c=c-2
Next I
End
cls
Deletea$="kathmandu"
p=1
for i= len(a$)=1 step -2
b$=mid$(a$,p,i)
print b$
p=p+1
next i
end
Armstrong number between two numbers
ReplyDeleteHey couldnt we find armstring number this way
ReplyDeleteCls
Input "enter ur no";a$
For i =1 to len(a$)
C$=MID$(a$,i,1)
D=val(c$)
E=E+D^3
Next i
R$=str$(E)
If R$=A$ then
Print "armstrong"
Else
Print "not armstrong"
End
Hey couldnt we find armstring number this way
ReplyDeleteCls
Input "enter ur no";a$
For i =1 to len(a$)
C$=MID$(a$,i,1)
D=val(c$)
E=E+D^3
Next i
R$=str$(E)
If R$=A$ then
Print "armstrong"
Else
Print "not armstrong"
End
not because we don't have to print the strong
Delete"$" sign represents string variable
DeleteWhat is the code of duck number in q basic???
ReplyDeletethank you !
ReplyDeleteHow to display this pattern
ReplyDelete5 4 3 2 1
5 4 3 2
5 4 3
5 4
5
Try out this way:
DeleteCLS
FOR Y=1 TO 5
FOR X=5 TO Y STEP-1
PRINT X;
NEXT X
PRINT
NEXT Y
END
I need Armstrong no.from range 1 to 1999 plz help.
ReplyDeletehow to Print 1 9 125 2401............10th term ||Please help me
ReplyDeleteCls
Deletea = 1
for b= 1 to 10
print a^b
a = a + 2
next
end
Write a program to input a number and check whether the number is palindrome pr not
ReplyDeleteCLS
DeleteINPUT"ENTER A NUMBER=";N
LET S = 0: P = N
WHILE (N>0)
D = N MOD 10
S = S * 10 + D
N = INT(N/10)
WEND
IF (S=P) THEN PRINT" PALINDROME NUMBER ="; P ELSE
END
how to write qbasic program to print the first 15 Armstrong number.
ReplyDeleteYour definition of Armstrong number is wrong.It should be-
ReplyDeleteThe number which is equal to sum of its digits raised to the power which is equal to the number of digits is known as Armstrong number.
1,2,3,4,5,...,9 are also Armstrong number which are not valided bu your program.
thanks for the answer
ReplyDeleteWAP to display all 3 digit armstrong numbers (i.e 100-999)
ReplyDeleteHelp me to convert decimal number into binary
ReplyDeleteHow to check whether the given number is a spy number or not?
ReplyDeleteHow to find?
ReplyDeleteWap to input any number and display whether it is perfect number or not.
how to print armstrong number between 100 to 999
ReplyDeleteAnother method of finding armstrong number
ReplyDeleteCls
Input "Enter a number";n$
For i=1 to len(n$)
b=val(mid$(n$,i,1))
c=c+b^3
next i
if val(n$)=c then
Print n$;"is an armstrong number"
else
Print n$;"is not an armstrong number"
end if
end
help me with this pls
ReplyDelete1 ,22, 333 ,4444 ,5555
CLS
DeleteFOR x = 1 TO 5
y = y + 10 ^ (x - 1)
PRINT i * a
NEXT
END
thanks
ReplyDeleteAre u aloud to use v\10 instead of int(v/10)
ReplyDeleteCLS
ReplyDeleteFOR n = 100 TO 999
k1 = k
WHILE c <> 0
r = k1 MOD 10
s = s + r ^ 3
k1 = k1 \ 10
WEND
IF k1 = s THEN
PRINT " it is an armstrong number ";
END IF
NEXT n
END
is this correct plz help me
ELSE missing
Deleteyou should write :
ELSE
PRINT"It is not an armstrong number."
(before end if)