Friday, 20 March 2015

Maximum and Minimum Number




 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include<stdio.h>
void main( void )
{
 int i ,m, q;
 int *j , *k,*l;
 j = &i;
 k=&m;l=&q;

 printf("Insert first  number: ");
 scanf("%d", j);
 printf("\nInsert second number: ");
 scanf("%d", k);
 printf("\nInsert third  number: ");
 scanf("%d", l);
 printf("\n");


 if(*j>*k)
 {
  if(*j>*l)
  {
   if(*k>*l)
   {
    printf("Maximum number is: %d\n", i);
    printf("Minimum number is: %d\n", q);
   }
   else
   {
    printf("Maximum number is: %d\n", i);
    printf("Minimum number is: %d\n", m);
   }
  }
  else
  {
   printf("Maximum number is: %d\n", q);
   printf("Minimum number is: %d\n", m);
  }
 }
 else if(*k>*l)
 {
  if(*j>*l)
  {
   printf("Maximum number is: %d\n", m);
   printf("Minimum number is: %d\n", q);
  }
  else
  {
   printf("Maximum number is: %d\n", m);
   printf("Minimum number is: %d\n", i);
  }
 }
 else
 {
  printf("Maximum number is: %d\n", q);
  printf("Minimum number is: %d\n", i);
 }
 printf("\n");
}

0 comments:

Post a Comment

 

Subscribe to our Newsletter

Contact our Support

Through the contact form

Our Team Memebers