Sunday, 30 October 2016

input and output using structure

#include<stdio.h>
struct student 
{
int reg_no;
int roll_no;
float marks ;

char name[25];



};

main()
{

struct student s1;
printf("\nEnter the student registration number :");
scanf("%d",&s1.reg_no);
printf("\nEnter the rollnumber: ");
scanf("%d",&s1.roll_no);
printf("\nEnter the marks :");
scanf("%f",&s1.marks);
printf("\nEnter the name :");
scanf("%s",&s1.name);
printf("\nParticulars enter by the user :");
printf("\nStudent registration number :%d",s1.reg_no);
printf("\nStudent roll number :%d",s1.roll_no);
printf("\nStudent name :%s",s1.name);
printf("\nStudent marks :%f",s1.marks);
}

No comments:

Post a Comment