Saturday 19 January 2013




C program that finds the smallest number by using id statement.

#include<stdio.h>
void main ()
{
      int a,b,c,d;
      int smallest_num=0;
      printf("Enter first number  :");
      scanf("%d",&a);
      printf("Enter second number :");
      scanf("%d",&b);
      printf("Enter third number :");
      scanf("%d",&c);
      printf("Enter fourth number :");
      scanf("%d",&d);
      if(a<b &&a<c  && a<d)
      {
            smallest_num=a;
            printf("Smallest number  is %d ",a);
      }
      if(b<a &&b<c && b<d)
      {
            smallest_num=b;
            printf("Smallest number  is %d ",b);
      }
      if(c<a && c<b && c<d )
      {
            smallest_num=c;
            printf("Smallest number  is %d ",c);
      }
      if(d<a && d<b && d<c)
      {
            smallest_num=d;
            printf("Smallest number  is %d ",d);
      }
}
OUT PUT :





C program for matric  board examination registration buy using if statement.

#include<stdio.h>
void main()
{
      int age;
      for(int i=0; i<10; i++)
      {
          printf("Enter your age for matric board registration:");
          scanf("%d",&age);
      if(age>=16 && age<=20)
      {
            printf("Your registration number is %d\n",i+1*100*2*age);
      }
      if(age>20)
      {
            printf("You are over age\n");
      }
      if(age<16)
      {
            printf("Your age is not required for matric board registration\n");
            printf("Please apply when you become 16 year old\n");
      }
      }
}

OUT PUT :