int Data Types and scanf Statement in C

Get Certified in C Programming and Take Your Skills to the Next Level

Program 1

#include<stdio.h>
#include<conio.h>
int main()
{
       int a=10,b=5,c;
      printf("Enter two number");
      scanf("%d%d",&a,&b);
      //scanf("%d",&a);
     // scanf("%d",&b);
      c=a+b;
      printf("\nAddition of %d and %d is %d",a,b,c);
      c=a-b;
      printf("\nSub of %d and %d is %d",a,b,c);
      c=a*b;
      printf("\nMultiplication of %d and %d is %d",a,b,c);
      c=a/b;
      printf("\nDivision of %d and %d is %d",a,b,c);
            return 0;
}

Program 2

#include<stdio.h>
#include<conio.h>
int main()
{
    int a,b;
    printf("Enter two Number");
    scanf("%d%d",&a,&b);
    printf(" Before swaping %d %d ",a,b);
      a=a+b;
      b=a-b;
      a=a-b;
    printf("\n After swaping %d %d ",a,b);  
return 0;
}

 

Your 15 seconds will encourage us to work even harder
Please share your happy experience on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *