WAP to enter any number and display: 1. To reverse the given digits . Ans à REM CLS S=0 INPUT “Enter a number”; N WHILE N<>0 R=N MOD 10 S=S * 10 + R N=N\10 WEND PRINT “The reverse number is”; S END 2. To display product of entered digits. Ans à REM CLS P=1 INPUT “ENTER A NUMBER”; N WHILE N<>0 R= N MOD 10 P= P *R N= N\10 WEND PRINT “THE PRODUCT OF ENTERED DIGITS IS”; P END 3. To display product of even digits. Ans à REM CLS P=1 INPUT “ENTER A NUMBER”; N WHILE N<>0 R= N MOD 10 IF R MOD 2=0 THEN P= P*R N=N\10 WEND PRINT “THE PRODUCT OF EVEN DIGITS IS”; P END 4. To display product of odd digits. Ans à REM CLS P=1 INPUT “ENTER A NUMBER”; N WHILE N<>0 R= N MOD 10 IF R MOD 2=1 THEN P= P*R N=N\10 WEND PRINT “THE...
Madam Curie was a famous scientist who received the Nobel Prize twice. Once she was given for her discover of radium and once for her outstanding achievement in Chemistry. She is greatly respected in the world of science. Madam Curie was born in the capital of Poland on November 7, 1867. Her name was Marie Sklodowaska. Her parents were teachers. She was a girl of sharp intellect. When she was six years old, her father died. Five years later her mother also passed away. Madam Curie passed High School at the age of sixteen. She was a very intelligent student. So she was awarded a gold medal. In those days there was no higher education for women in Poland . So she had to look for job. At last she started her career as a teacher. ...
WAP to enter any number and display: 1. Sum of digits. Ans à REM CLS S: 0 INPUT “ENTER A NUMBER”;N WHILE N <> 0 R = N MOD 10 S = S + R N = N \10 WEND PRINT “SUM OF DIGITS IS” ; S END 2. Sum of even digits. Ans à REM CLS S: 0 INPUT “ENTER A NUMBER”;N WHILE N <> 0 R = N MOD 10 IF R MOD 2 = 0 THEN S = S + R N = N \10 WEND PRINT “SUM OF EVEN DIGITS IS ” ; S END 3. Sum of odd digits. Ans à REM CLS S: 0 INPUT “ENTER A NUMBER”;N WHILE N <> 0 R = N MOD 10 IF R MOD 2 = 1 THEN S = S + R N = N \10 WEND PRINT “SUM OF ODD DIGITS IS” ; S END 4. Sum of square of digits. Ans à REM CLS S=0 INPUT “ENTER A NUMBER”; N WHILE N<>0 R= N MOD 10 S = S+R^2...
Comments
Post a Comment