Why it is asking for 4 input instead of 3 ? I have used only 3 scanf in my program. This is a program about finding smallest and largest number among 3 variables. Please Help...
#include <stdio.h>
int main()
{
int first, second, third;
printf("Enter 3 integers for compare:");
scanf("%d\n",&first);
scanf("%d\n",&second);
scanf("%d\n",&third);
if((first>second) && (first>third))
printf("First number is the largest\n");
else if((second>first) && (second>third))
printf("Second number is the largest\n");
else if((third>second) && (third>first))
printf("\nThird number is the largest\n");
if((first<second) && (first<third))
printf("First number is smallest\n");
else if((second<first) && (second<third))
printf("Second number is smallest\n");
else if((third<second) && (third<first))
printf("Third number is smallest\n");
return 0;
}