write the program to display the result of student on marks obtained .
Answers
Answered by
3
control flow statement
{
public static void main(string arg[])
{
int marks = 78
if (marks > =60)
system.out.printIn (" Your marks are " +marks+" and you are passed");
else
system.out.printIn ("Your marks are " +marks+"and you are failed");
}
}
{
public static void main(string arg[])
{
int marks = 78
if (marks > =60)
system.out.printIn (" Your marks are " +marks+" and you are passed");
else
system.out.printIn ("Your marks are " +marks+"and you are failed");
}
}
Anonymous:
thx
Answered by
2
#define SUBJECTS 6
#define PASSMARK 35
void main(int argc, char *argv[])
{
int n = 0, marks [SUBJECTS], failed=0;
for (n = 0; n < SUBJECTS ; n++ ) // read in marks for all subjects
scanf("%d",& marks[n]);
for (n = 0; n < SUBJECTS ; n++ ) // check for pass in each subject
if (marks[n] < PASSMARK) failed++;
// now check
if (failed > 0) then
printf("You have failed in %d number of subjects :( , better luck next time \n", failed);
else
printf("You have passed in all subjects! Congrats! :) \n");
}
#define PASSMARK 35
void main(int argc, char *argv[])
{
int n = 0, marks [SUBJECTS], failed=0;
for (n = 0; n < SUBJECTS ; n++ ) // read in marks for all subjects
scanf("%d",& marks[n]);
for (n = 0; n < SUBJECTS ; n++ ) // check for pass in each subject
if (marks[n] < PASSMARK) failed++;
// now check
if (failed > 0) then
printf("You have failed in %d number of subjects :( , better luck next time \n", failed);
else
printf("You have passed in all subjects! Congrats! :) \n");
}
Similar questions
Physics,
8 months ago
Social Sciences,
8 months ago
Chemistry,
8 months ago
English,
1 year ago
Math,
1 year ago