Search This Blog

Thursday, October 13, 2011

Write a program to read two real num x1 and y1 and display their sum rounded off to three places.

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  void main()
   4:  {
   5:  float x1,y1,sum;
   6:  printf("Enter Values of x1 and y1:\n");
   7:  scanf("%f%f",&x1,&y1);
   8:  sum=x1+y1;
   9:  printf("Sum=%10.3f\n",sum);
  10:  getch();
  11:  }

No comments:

Post a Comment