Quote:
Originally Posted by 143rocker View Post
sorry for that reply....this is the real one

Code:
#include <stdio.h>
#include <conio.h>
main()
{
  float n1,n2,s,d,p,q;
  clrscr();
  printf("\n Enter two nos");
  scanf("%f%f"&n1,&n2);
  s=n1+n2
  d=n1-n2;
  p=n1*n2;
  q=n1/n2;
  printf("\n Sum %f",s);
  printf("\n Difference %f",d);
  printf("\n Product %f",p);
  printf("\n Quotient %f",q);
  getch();
  return(0);
}
Thanks, and it is good, but...
To give the program some readability:

Code:
#include <stdio.h>
#include <conio.h>
main()
{
  float n1,n2,s,d,p,q;
  printf("\n Enter two numbers:  ");
  scanf("%f %f", &n1, &n2);
  s=n1+n2;
  d=n1-n2;
  p=n1*n2;
  q=n1/n2;
  printf("\n Sum        %9.2f",s);
  printf("\n Difference %9.2f",d);
  printf("\n Product    %9.2f",p);
  printf("\n Quotient   %9.2f",q);
  getch();
  return(0);
}

Last edited by shabbir; 14Feb2011 at 14:15.. Reason: Code blocks