Now here we are creating a simple program for structure Sum of two Number is structure.

#include<stdio.h>
 #include <conio.h>
 struct Sum { int x , y ; }s1;
 //here s is the member of structure that’s helps for accessing these variable x , y 
 void main ( ){ 
 int s ;
 clrscr ( ) ;
 printf ( "Enter two number!" ) ;
 scanf (" %d %d ", &s1 . x, &s1 . y) ;
 s = s1 . x + s1. y ;
 printf ( "The sum of two number is %d" ,s ) ;
 getch ( ) ;
 }

Output:-Enter two number! 10 10
The sum of two number is 20

This article is written by our awesome writer
Comments to: Simple program using structure in C

Your email address will not be published. Required fields are marked *

Attach images - Only PNG, JPG, JPEG and GIF are supported.

New Dark Mode Is Here

Sign In to access the new Dark Mode reading option.

Join our Newsletter

Get our monthly recap with the latest news, articles and resources.

By subscribing you agree to our Privacy Policy.

Latest Articles

Explore Tutorials By Categories

About

Codeverb is simply an all in one interactive learning portal, we regularly add new topics and keep improving the existing ones, if you have any suggestions, questions, bugs issue or any other queries you can simply reach us via the contact page

Login

Welcome to Codeverb

Ready to learn something new?
Join Codeverb!

Read Smart, Save Time
  •  
    Strength indicator
  •  
  •  
    Log In | Lost Password