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!”);
#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;
}
Comments
Leave a comment