DEVANSHU 1324035
4. SOURCE CODE:
#include<stdio.h>
#include<conio.h>
void main();
{ //variable declaration
char name[50];
int rollno;
float sub1,sub2,sub3,sub4;
float obtained;
float per;
//Take input for above
{ printf(“Enter the name of Student:”);
scanf(“%s”,name);
printf=(“Enter the RollNo of Student:”);
scanf=(“%d”,&rollno);
printf=(“sub1:”);
scanf=(“%f”,&sub1);
printf=(“sub2:”);
scanf=(“%f”,&sub2);
printf=(“sub3:”);
scanf=(“%f”,&sub3);
printf=(“sub4:”);
scanf=(“%f”,&sub4);
//Calculate the percentage
obtained=sub1+sub2+sub3+sub4;
per=(obtained/400)*100;
//Display the information
printf(“\nName of the Student:%s”,name);
printf(“\nRollNo of the Student:%d”,rollno);
printf(“\nPercentage of the Student:%f”,per);
}
getch();
}
DEVANSHU 1324035
5. OUTPUT:
DEVANSHU 1324035
PROGRAM NO.3
1. STATEMENT:
Write a program to take input of name, rollno and marks
obtained by a student in 4 subjects of 100 marks each and
display the name, rollno with percentage score secured.
2. ALGORITHM:
Step1: Start
Step2: Declaration of variable
Step3: Input of the variables
Step4: Calculate the percentage
Step5: Output of information
Step6: Stop
3. FLOW CHART:
START
Input the variables
Calculate the percentage
Output of information
STOP