Technology Lesson
Showing posts with label
structure
.
Show all posts
Showing posts with label
structure
.
Show all posts
Thursday, February 12, 2015
C program to add two numbers using structure
#include<stdio.h>
#include<conio.h>
struct sum
{
int a;
int b;
};
void main()
{
int sum1;
struct sum s;
clrscr();
printf("Enter two numbers:");
scanf("%d%d",&s.a,&s.b);
sum1=s.a+s.b;
printf("
Sum=%d",sum1);
getch();
}
Read more »
Older Posts
Home
Subscribe to:
Posts (Atom)