Skip to main content

Posts

Showing posts with the label Write a C program to enter two numbers and find their sum

ads1

C Language Tutorial

C Language    Write a C program to enter two numbers and find their sum.   Static Program #include<stdio.h> #include<conio.h> void main() {     clrscr();     int a =10,b=20,sum;     sum = a+b;     printf("The sum of two number is :- %d",sum); getch(); } Output :-  Dynamic Program   #include<stdio.h> #include<conio.h> void main() {     clrscr();     int a,b,sum;     printf("Enter the first number :- ");     scanf("%d",&a);     printf("Enter the second number :- ");     scanf("%d",&b);     sum = a+b;     printf("The sum of two number is :- %d",sum);     getch(); }    Output :-     

ads2