Answer to Question #274641 in C for Lucky

Question #274641

Description



You have to explain these instructions below with respect to the Type Systems and Type Expressions:




int number=5, d;




float m=25.5;




d=m/number;




if(number %d==0)




printf(“Divisible”);




else if(m%d)




printf(“Non-Divisible”);




else




printf(“Wrong program!”);

1
Expert's answer
2021-12-04T12:13:10-0500
#include <stdio.h>

int main() {
  int number=5, d; // init int data type
  float m=25.5;    // init float data type
  d=m/number;      // assing value for d
  if(number %d==0)
    printf(“Divisible”);  // if number is divisable by d then print "Divisable"
  else if(m%d)
    printf(“Non-Divisible”); // if m is not divisable by d then print "Not-divisable"'
  else
    printf(“Wrong program!”); // In other cases print "Wrong program!"
  return 0;
}

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
New on Blog
APPROVED BY CLIENTS