#include<stdio.h>
#include<conio.h>
main()
{
int a,b;
clrscr()
printf("Enter two no's:\n");
scanf("%d %d",&a,&b);
printf("sum of two numbers is:%d",a+b);
getch();
}
out put : Enter two no's: 2 3
sum of two numbers is:5
(or)
#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
float a,b,sum;
printf("Enter two numbers:");
scanf("%f%f",&a,&b);
sum=a+b;
printf("sum of two numbers is:%.2f",sum);
getch();
}
out put : Enter two numbers: 2.5 3.5
sum of two numbers is:6.00
(or)
#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
int a,b,sum;
printf("Enter two numbers:");
scanf("%d%d",&a,&b);
sum=a+b;
printf("sum of two numbers is:%d",sum);
getch();
}
out put : Enter two numbers: 2 3
sum of two numbers is:5
#include<conio.h>
main()
{
int a,b;
clrscr()
printf("Enter two no's:\n");
scanf("%d %d",&a,&b);
printf("sum of two numbers is:%d",a+b);
getch();
}
out put : Enter two no's: 2 3
sum of two numbers is:5
(or)
#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
float a,b,sum;
printf("Enter two numbers:");
scanf("%f%f",&a,&b);
sum=a+b;
printf("sum of two numbers is:%.2f",sum);
getch();
}
out put : Enter two numbers: 2.5 3.5
sum of two numbers is:6.00
(or)
#include<stdio.h>
#include<conio.h>
main()
{
clrscr();
int a,b,sum;
printf("Enter two numbers:");
scanf("%d%d",&a,&b);
sum=a+b;
printf("sum of two numbers is:%d",sum);
getch();
}
out put : Enter two numbers: 2 3
sum of two numbers is:5