Skip to content

Instantly share code, notes, and snippets.

@msuryaprakash
Last active December 7, 2015 13:48
Show Gist options
  • Save msuryaprakash/ffea022bea6bbf464d77 to your computer and use it in GitHub Desktop.
Save msuryaprakash/ffea022bea6bbf464d77 to your computer and use it in GitHub Desktop.
#include <stdio.h>
main()
{
int first, second, add, sub, mul;
float divi;
printf("Enter two integers\n");
scanf("%d %d", &first, &second);
add = first + second;
sub = first - second;
mul = first * second;
div = first / (float)second; //Typecasting
printf("Sum = %d\n",add);//Addition
printf("Subtraction = %d\n",sub);//Subtraction
printf("Multiplication = %d\n",mul);//Multiplication
printf("Division = %.2f\n",divi);//Division
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment