+ 2
this c program is giving garbage value . Can anyone help me find the mistake
#include <stdio.h> int main(){ int num1,num2,num3; printf("Enter three Interger Numbers and i will give you the smallest value.\n"); printf("Enter fisrt value : "); scanf("%d",&num1); printf("\nEnter Second value : "); scanf("%d",&num2); printf("\nEnter Third Value : "); scanf("%d",&num3); if(num1<num2 && num1<num3){ printf("\n%d is the smallest number",&num1); } if(num2<num1 && num2<num3) { printf("\n%d is the smallest number",&num2); } { if(num3<num2 && num3<num1) printf("\n%d is the smallest number",&num3); } return 0; }
3 Réponses
+ 3
Dont use &num1, but directly num1
Continue it to 3
+ 2
printf(%d, num1)
+ 1
thanks guys!