User Input and Type Conversion

#include <stdio.h>

int main() {
    // User input and type conversion
    int num1, num2;
    float result;

    printf("Enter two integers: ");
    scanf("%d %d", &num1, &num2);

    result = (float)num1 / num2;

    printf("Result of division: %f\n", result);

    return 0;
}
chevron_left
chevron_right

Leave a comment

Your email address will not be published. Required fields are marked *

Comment
Name
Email
Website