Wednesday, 5 December 2012

CPL PROGRAM 14a CODING

               SIMPLE STRUCTURE PROGRAM
                                                     
CODING:                                                            
                                                                                                        
#include<stdio.h>
#include<conio.h>
struct student
{
 int rollno;
 char name[10],grade;
 float percent;
}a;
void main()
{
 clrscr();
 printf("\n Enter the Student information");
 printf("\n Enter Student Roll NO : ");
 scanf("%d",&a.rollno);
 printf("\n Enter the Student Name : ");
 scanf("%s",&a.name);
 printf("\n Enter the percent : ");
 scanf("%f",&a.percent);
 printf("\n Enter the student grade : ");
 scanf("%c",&a.grade);
 printf("\n Roll no :%d",a.rollno);
 printf("\n Name    :%s",a.name);
 printf("\n Percent :%f",a.percent);
 printf("\n Grade   :%c",a.grade);
 printf("\n Size of :%d",sizeof(a));
getch();
}

No comments:

Post a Comment