Techies forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Techies forums

Forum for the students of Tagore engineering college IT department


You are not connected. Please login or register

C PROGRAM

Go down  Message [Page 1 of 1]

1C PROGRAM Empty C PROGRAM Tue Aug 24, 2010 10:12 pm

Karthicknet1

Karthicknet1
grown up punk
grown up punk

//STUDENT STRUCTURE//
#include<stdio.h>
#include<conio.h>
main()
{
struct student{
int rollno;
char name[30];
int mark1,mark2,mark3,total;
float average;
};
struct student *s;
clrscr();
printf("Enter the Number :" );
scanf("%d",&s->rollno);
flushall();
printf("Enter Student Name : ");
gets(s->name);
printf("Enter Marks : ");
scanf("%d,%d,%d",&s->mark1,&s->mark2,&s->mark3);
s->total=s->mark1+s->mark2+s->mark3;
s->average=s->total/3;
printf("Total : %d\n",s->total);
printf("Average : %3.2f",s->average);
getch();
}

http://karthicknet1.blogspot.com

Back to top  Message [Page 1 of 1]

Similar topics

-

» Simple Date Program in Java

Permissions in this forum:
You cannot reply to topics in this forum