C program to add two numbers using structureStructure / 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(); }
C program that compare two given dates. To store a date use a structure that contains three members namely day, month and year. If dates are equal then display a message as EQUAL otherwise UNEQUAL
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);