C program to add two numbers using structure 2 Comments / Structure / By Neeraj Mishra #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(“nSum=%d”,sum1); getch(); } You May Also Like:C++ Program to print a man using graphicsIs 200-125 CCNA Exam Worth Taking?Data Encryption Standard (DES) AlgorithmC Program for Addition and Multiplication of Polynomial Using Arrays or Linked ListProgram to Reverse Number in C
sarang_agarwal November 18, 2013 at 2:33 am does this gives any advantage if we would have instead simply added using variables in the main itself>? Reply
Ranjan January 22, 2019 at 6:44 am Sir program me kuchh galti hai. 11th and 16th line me. In 11th line: sum s; In 16th line: print(“\n sum=%d”,sum1); Reply
does this gives any advantage if we would have instead simply added using variables in the main itself>?
Sir program me kuchh galti hai.
11th and 16th line me.
In 11th line: sum s;
In 16th line: print(“\n sum=%d”,sum1);