Search This Blog

Thursday, October 13, 2011

Write a function to find squre and cube of a num

   1:  #include<stdio.h>
   2:  #include<conio.h>
   3:  void squrecube(float x,float *s,float *c)
   4:  {
   5:  *s=x*x;
   6:  *c=x*x*x;
   7:  }
   8:  void main()
   9:  {
  10:  float x,s,c;
  11:  printf("enter the num:");
  12:  scanf("%f",&x);
  13:  squrecube(x,&s,&c);
  14:  printf("squre=%f cube=%f",s,c);
  15:  getch();
  16:  }

No comments:

Post a Comment