Wednesday 21 December 2011

SQURE OF A NUMBER


  • To input three integer quantities to the variables a,b,c and then perform the following
1.halves the value of a
2.doubles b
3.multiply c by itself
4.display the result of the preceding operations


#include<stdio.h>
Void main()
{
Int a,b,c;
Clrscr();
Printf(“enter three numbers\n”);
Printf(“first number?”);
Scanf(“%d”,&a);
Rpintf(“second number?”);
Scanf(“%d”,&b);
Printf(“third number ?”);
Scanf(“%d”,&c);
Printf(“half of %d is %g\n”,a,a/2.0);
Printf(double fo %d is %d\n”,b,b+b);
Printf(“square of %d is %d\n”,c c*c);
getch();
}

No comments:

Post a Comment