Here’s a simple Java program that prompts the user for the number of students and then collects marks for five subjects to print a marksheet:
import java.util.Scanner;
public class MarksSheet {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter the number of students: ");
int numStudents = scanner.nextInt();
for (int i = 1; i <= numStudents; i++) {
System.out.println("Entering marks for Student " + i);
int[] marks = new int[5];
for (int j = 0; j < 5; j++) {
System.out.print("Enter marks for Subject " + (j + 1) + ": ");
marks[j] = scanner.nextInt();
}
System.out.println("Marks for Student " + i + ": " + java.util.Arrays.toString(marks));
}
scanner.close();
}
}
This program uses a loop to gather and display marks for each student across five subjects.
main() { int p,m1,m2,m3,m4,m5; printf("enter marks of 5 subjects"); scanf("%d%d%d%d%d",&m1,&m2,&m3,&m4,&m5)l p=(m1+m2+m3+m4+m5)/500*100; if(p>=60) printf("first"); else { if(p>=50) printf("second"); else { if(p>=40) printf("third"); else printf("fail"); } } }
The definiton of input number is the number going in. The input number is the oppsite of the output number. For instance:Input Output1 52 103 154 205 25The rule of the input and output number is input times five equals output.
Output documentation
:Input "X1",A :Input "X2",B :Input "Y1",C :Input "Y2",D :(D-C)/(B-A)->E :Disp "SLOPE:",E
The answer depends on what the "number machine" does. For example, if it quadruples, the input should be 10; if it halves, the input should 80; if it adds 10, the input should be 30; and so on.
hhh
program that take three decimal number as input and find the largest among them in assembly language
In a computer program, a legal input is something that can be put into a program and it will work. An illegal input may crash the program.
main() { int p,m1,m2,m3,m4,m5; printf("enter marks of 5 subjects"); scanf("%d%d%d%d%d",&m1,&m2,&m3,&m4,&m5)l p=(m1+m2+m3+m4+m5)/500*100; if(p>=60) printf("first"); else { if(p>=50) printf("second"); else { if(p>=40) printf("third"); else printf("fail"); } } }
without understanding the program giving a input
No, as long as it calculates something, displays something, or otherwise has an output that benefits the user, it is a program. It could be a program that makes a random number, or a program that tells the user a joke from a database.
<script type = "text/javascript"> var input; var rev = 0; input=window.prompt ("Please enter a 5-digit number to be reversed."); input = input * 1; while (input > 0) { rev *= 10; rev += input % 10; input /= 10; } document.write ("Reversed number: " + rev); </script>
create a program that can input 100 names
Use Wolfram|Alpha... go to the related link below, Wolfram|Alpha, and type in (is __ (number) prime) and then the program will compute that and tell you if it is prime or composite.
Assuming you've entered a multi-digit number whole number (an integer), then take the modus (%) of the number and 10. E.g., if the number input was 1234, then 1234 % 10 is 4. Thus the final digit is 4. Note that modus 10 is the same as dividing the number by 10 and taking the remainder.
A robust program is a program that will accept junk input and not crash. Example: a program that accepts "pancakes" for a date input and pops up a error box or just uses a date input so that this does not happen is a robust program.