Twitter Feed Facebook Google Plus Youtube

Adsense responsive

Recent Post below header

Friday 12 April 2013

C PROGRAM: TO PRINT STUDENT RECORD USING STRUCTURE POINTER

CODING:
#include<conio.h>
#include<stdio.h>
struct stud_record
{
 char name[25];
 char cls[5];
 int roll_no;
};
void main()
{
 struct stud_record student,*s;
 clrscr();
 s=&student;
 printf("Enter name: ");
 scanf("%s",s->name);
 printf("Enter class: ");
 scanf("%s",s->cls);
 printf("Enter roll no.: ");
 scanf("%d",&s->roll_no);
 printf("\n\n");
 printf("RECORD ENTERED\nName: %s\n",s->name);
 printf("Class: %s",s->cls);
 printf("\nRoll no. %d",s->roll_no);
 getch();
}

CODING
OUTPUT

For any query or suggestion please comment below...

No comments:

Post a Comment