Tuesday, 2024-12-24, 9:14 PM
ebooks Programming Computer Science
Welcome Guest | RSS
Site menu
Section categories
My articles [23]
Main » Articles » My articles

How to find out smallest number among 3 numbers without conditional statement
#include<stdio.h>

 int smallest(int a,int b,int c)
{
     int p=0;
     
     while(a && b && c)
     {
        a--;b--;c--;p++;    
     }
     return p;
}

void main()
{
     int a=3,b=5,c=9;

     printf("The smallest number among 3 numbers is %d\n",smallest(a,b,c));
}
Category: My articles | Added by: Sumrat (2012-11-30)
Views: 9453 | Rating: 0.0/0
Total comments: 0
Name *:
Email *:
Code *:
Our poll
Rate my site
Total of answers: 164
Statistics

Total online: 2
Guests: 2
Users: 0
Login form