10 cls 20 input"enter word";word$ 30 print word$ 40 print len(word$) 50 end this program is for GW BASIC for other BASIC's the line numbers are optional.
' '*** PROGRAM: Collecting student data: names/marks. ' '*** Create 2 array variables to store each students name/marks... DIM students$(10), marks$(10) '*** SCREEN ONE/Collect the data... CLS '...(CL)ear the Output (S)creen '*** print heading... PRINT "PROGRAM: Collecting each student names/marks..." PRINT '*** A FOR/NEXT loop is used to collect each individual students data... FOR eachStudentNo% = 1 TO 10 '*** Get each students names/marks 'by typing these values in from the keyboard.... PRINT eachStudentNo%; ">" INPUT " Enter student name"; students$(eachStudentNo%) INPUT "Enter student marks"; marks$(eachStudentNo%) NEXT '*** SCREEN TWO: Output the collected data... CLS '...(CL)ear the Output (S)creen '*** Print headings... PRINT "Student No.", "Student Name", "Student Marks" PRINT '*** FOR/NEXT loop is used to print out the 2 array student 'name/marks' values... FOR eachStudentNo% = 1 TO 10 '*** print out each students 'number/name/mark' values... PRINT eachStudentNo%, PRINT students$(eachStudentNo%), PRINT marks$(eachStudentNo%) NEXT END '...END of program/halt program code execution
10 input "enter a no."; n 20 for i = 1 to n 30 if n mod i = 0 then c = c +1 40 next i 50 if c = 2 then print "prime number" else print "not a prime number" 60 end
All the smallest factors of a number must be its smallest factor, which for any number is 1, so: loop loop loop print "Enter an integer number: ": input n until num(n) do print "Please enter a number" repeat until n = int(n) do print "Please enter an integer" repeat print "Smallest factor of ":n:" is 1" repeat
To create a PHP program that prints a marksheet, you can start by defining an associative array to store subjects and their corresponding marks. Use a loop to iterate through the array and calculate total marks and percentage. Finally, format the output using HTML for better presentation, and utilize the echo statement to display the marksheet. Here’s a simple example: <?php $marks = ["Math" => 85, "Science" => 78, "English" => 92]; $total = array_sum($marks); $percentage = ($total / (count($marks) * 100)) * 100; echo "<h1>Marksheet</h1>"; foreach ($marks as $subject => $mark) { echo "$subject: $mark<br>"; } echo "Total: $total<br>"; echo "Percentage: $percentage%"; ?>
hhh
DIM grade(6), lowGrade(5), testName$(6), seq$(6) seq$(1) = "first " seq$(2) = "second" seq$(3) = "third " seq$(4) = "fourth" seq$(5) = "fifth " grLetter$ = "ABCD" begin: COLOR 7, 0 CLS PRINT "Test averaging program" PRINT "======================" PRINT PRINT "Lets enter some basic info before we get started .." PRINT FOR ix% = 1 TO 4 PRINT "enter a number (1-100) that you consider to be the lowest "; MID$(grLetter$, ix%, 1); INPUT lowGrade(ix%) PRINT STRING$(78, "-") NEXT ix% enterTests: COLOR 7, 0 CLS LINE INPUT "Enter student name or / to end program: "; name$ IF name$ = "/" THEN CLS END END IF LINE INPUT "Enter student age : "; age$ age% = VAL(age$) PRINT STRING$(78, "=") FOR ix% = 1 TO 5 PRINT "Enter the subject name for the "; seq$(ix%); " test: "; LINE INPUT testName$(ix%) LINE INPUT "Enter the grade for this test (1-100): "; grade$ grade(ix%) = VAL(grade$) PRINT STRING$(78, "-") NEXT ix% CLS displayReport: COLOR 7, 0 CLS GOSUB computeAverage PRINT "Test Average Report for "; name$ PRINT PRINT "Age is "; age$ IF (age% >= 25) = 0 THEN COLOR 6, 0 PRINT " ** Student is underage **" END IF COLOR 7, 0 stuGrade = average GOSUB determineAthruF PRINT "Test average is"; PRINT USING "###.##"; average PRINT "This is a grade of "; grade$ IF grade$ = "F" THEN COLOR 4, 0 PRINT "** Student did not pass **" END IF COLOR 7, 0 PRINT PRINT "Test Summary (those in "; COLOR 4, 0 PRINT "red"; COLOR 7, 0 PRINT " are failing)" PRINT FOR ix% = 1 TO 5 COLOR 7, 0 stuGrade = grade(ix%) GOSUB determineAthruF rptName$ = SPACE$(25) MID$(rptName$, 1) = testName$(ix%) IF grade$ = "F" THEN COLOR 4, 0 END IF PRINT rptName$, grade$, PRINT USING "###.##"; stuGrade NEXT ix% COLOR 7, 0 PRINT LINE INPUT "Do you wish to average another student (Y/N) "; yn$ yn$ = UCASE$(yn$) IF yn$ = "Y" THEN GOTO enterTests END IF END computeAverage: total = 0 FOR ix% = 1 TO 5 total = total + grade(ix%) NEXT ix% average = total / 5 RETURN determineAthruF: IF stuGrade >= lowGrade(4) THEN grade$ = "D" IF stuGrade >= lowGrade(3) THEN grade$ = "C" IF stuGrade >= lowGrade(2) THEN grade$ = "B" IF stuGrade >= lowGrade(1) THEN grade$ = "A" END IF END IF END IF ELSE grade$ = "F" END IF RETURN
"print" will output a value onto the screen for a user to see. "input" or "raw_input" gets a user's input.
Input "enter name" ;n$ input "enter marks" ; m ifm > 40 then print n$, "pass" else print n$, "fail"
Starts Input a,b Result=(a-b)*(a-b) Print"square of difference=",result
all subjects blue print for 10th matric board exam
i want plus 1 blue print for all subjects
INSTALL @lib$+"FNUSING" REPEAT PRINT "Press 1 for RATES" PRINT "Press 2 for CONVERTER" PRINT "Press 3 for EXIT" INPUT "Enter the number for the converter: " mode% REM Rates IF mode%=1 THEN PRINT "Press 1 for euro rate" PRINT "Press 2 for usa dollar rate" PRINT "Press 3 for japanese yen rate" PRINT "Press 4 for british pounds rate" INPUT "Enter currency: " choice% CASE choice% OF WHEN 1:INPUT "Enter rate for EURO to GBP" EURtoGBPrate# INPUT "Enter rate for EURO to YEN" EURtoYENrate# INPUT "Enter rate for EURO to USD" EURtoUSDrate# WHEN 2:INPUT "Enter rate for USD to EURO" USDtoEUROrate# INPUT "Enter rate for USD to YEN" USDtoYENrate# INPUT "Enter rate for USD to GBP" USDtoGBPrate# WHEN 3:INPUT "Enter rate for YEN to EURO" YENtoEUROrate# INPUT INPUT WHEN 4:INPUT INPUT INPUT ENDCASE ENDIF REM Convert IFmode%=2 THEN PRINT "Press 1 for euro converter" PRINT "Press 2 for japanese yen converter" PRINT "Press 3 for usa dollar converter" PRINT "Press 4 for british pounds converter" INPUT "Enter the number for the converter: " choice% CASE choice% OF WHEN 1: PRINT "You chose option 1 for euro converter" WHEN 2: PRINT "You chose option 2 for japanese yen converter" WHEN 3: PRINT "You chose option 3 for usa dollar converter" WHEN 4: PRINT "You chose option 4 for british pounds converter" ENDCASE PRINT FNusing("##.##",.15) PRINT "The amount that you want to covert" PRINT "Enter the amount that you want to convert" ENDIF UNTIL mode% = 3
by input class
// get input char input[256]; gets(input); // print one character on each line int i; for(i = 0; input[i] != '\0'; ++i) { printf("%c\n", input[i]); }
It means that python will print(or write out) a value you input.
HomeSchoolMath.com allows you print worksheets by subject and grade level. Try this link for some 4th grade math worksheets: http://www.homeschoolmath.net/worksheets/grade_4.php