Structure In C Program


#include<stdio.h>
#include<conio.h>
struct add
{
	int a,b,c;
	float av;
};
void main()
{
	struct add o;
	struct add o1; //object
	clrscr();
	printf("\nEnter The Numbers :");
	scanf("%d%d",&o.a,&o.b);
	o.c=o.a+o.b;
	o.av=o.c/2;              //www.tutorjoes.com
	printf("\nTotal : %d",o.c);
	printf("\nAverage :%f",o.av);
	printf("\nEnter The Numbers :");
	scanf("%d%d",&o1.a,&o1.b);
	o1.c=o1.a+o1.b;
	o1.av=o1.c/2;
	printf("\nTotal : %d",o1.c);
	printf("\nAverage :%f",o1.av);
	getch();
}



Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming