Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR BASIC

convert from c to c++ online

 #include <stdio.h>

int main()
{
    int num, max, min;

    printf ("Enter four numbers: ");
    scanf ("%d", &num);
    max = min = num;

    for (int i = 0; i < 3; i++)
    { 
        scanf ("%d", &num);
        if (max < num)
            max = num;
        else if (min > num)
            min = num;
    }

    printf ("The smallest and largest of given four numbers are %d and %d respectively.
", min,  max);
    return 0;
}




















Source by www.w3schools.blog #
 
PREVIOUS NEXT
Tagged: #convert #online
ADD COMMENT
Topic
Name
2+6 =