Monday 24 October 2016

Program : W A P to read one integer and one float type variablecalculate sum,difference, product and division on them and display the results in formatted manner.



#include<stdio.h>
#include<conio.h>
  void main()
  { int a; float b,s,d,div;clrscr();
    printf("Enter the value of a:");
    scanf("%d",&a);
    printf("Enter the value of b:");
    scanf("%f",&b);
    s=a+b;
    d=a-b;
    div=a/b;
    printf("\nsum=%f\ndif=%f\ndiv=%f",s,d,div);
    getch();

Output:

No comments:
Write comments