//Normal program
#include<stdio.h>
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c=0;
printf("Enter No to add: ");
scanf("%d %d",&a,&b);
c=a+b;
printf("%d + %d= %d",a,b,c);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int a=10,b=30;
printf("%d",a+b);
getch();
}
output:- 40
//Ask number from user to add
#include<conio.h>
void main()
{
int a,b,c=0;
printf("Enter No to add: ");
scanf("%d %d",&a,&b);
c=a+b;
printf("%d + %d= %d",a,b,c);
getch();
}
No comments:
Post a Comment