Answer to Question #96278 in C for Shruti

Question #96278
Write a Function that outputs
a) The String : The one half is 50%.
b) Two integers and their difference.
c) Two floats and the result of dividing one with the other.
1
Expert's answer
2019-10-11T14:24:36-0400

a)

void HalfString(char *arr, int size)

{

  int i;

  for(i = 0; i < size/2; ++i)

  {

    printf("%c", arr[i]);

  }

}


b)

void TwoIntDiff(int a,int b)

{

  int res = a - b;

  printf("a = %d  b = %d res = %d", a, b, res);

}


c)

void TwoFloatDiv(float a, float b)

{

  float res = a/b;

  printf("a = %f  b = %f res = %f", a, b, res);

}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS