Program for the addition of two numbers





1. W.A.P. for the addition of two numbers.

#include<stdio.h>
#include<conio.h>
main()
{
         int num1,num2,sum;
        clrscr();
        printf(" Enter the value of num1 and num2 : -    ");
        scanf("%d %d",&num1,&num2);
        sum=num1+num2;
        printf(" Sum of two number is %d",sum);
       getch();
}

OUTPUT :

Enter the value of num1 and num2:-  5 8
Sum of two number is 13

Fundamental of C language
    
2. W.A.P for the addition, subtraction, multiplication, division
    of two numbers.

#include<stdio.h>
#include<conio.h>
main()
{
               int num1,num2,sum,sub,mul;
               float div=0;
               clrscr();
               printf("Enter the values of two numbers   :-  ");
               scanf("%d %d", &num1,&num2);
              sum=num1+num2;
              sub=num1-num2;
              mul=num1*num2;
              div=num1/num2;
              printf("sum is = %d\n Sub is = %d\n Mul is = %d\n 
                          Div is   = %d",sum,sub,mul.div);
             getch();

}


OUTPUT :

Enter the value of num1 and num2:-  9 3
Sum  is = 12
Sub  is = 6
Mul is = 27
Div is = 3

You can see..
Program for Sum of digit
SHARE

Milan Tomic

Hi. I’m Designer of Blog Magic. I’m CEO/Founder of ThemeXpose. I’m Creative Art Director, Web Designer, UI/UX Designer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment

Important of Database privilages

Database privileges Privileges are the right or permission to execute particular SQL statements.                           System Se...