#include<stdio.h>
#include<stdlib.h>
int main()
{
& int a,b,c, m, k;
& // generate random digits
& a=rand()%10;
& b=rand()%10;
& c=rand()%10;
& // calculate minimum of a,b,c
& m = (a<b) ? a : b;
& if (c<m) { m=c; };
&
& printf("Please enter minimum of the following numbers a,b,c:\n");
& printf("a=%d, b=%d, c=%d\n", a,b,c);
& scanf("%d",&k);
&
& if(k==m)
& {
printf("Your answer is correct!\n");
& }
& else
& {
printf("Your answer is not correct!\n");
& };
& return 0;
};
Comments
Leave a comment