Professional Documents
Culture Documents
If Else
If Else
If Else
Eligible to vote :
#include<stdio.h>
void main()
{
int age;
printf("Enter your age : ");
scanf("%d",&age);
if (age >= 18)
{
printf("You are eligible to vote ^_^ !!");
}
else
{
printf("You are not eligible to vote >_< !!");
}
}
if (amount>1000)
{
printf("10% Discount is granted \n");
discount = amount*0.10;
total = amount-discount ;
}
else
{
printf("5% Discount is granted \n");
discount = amount*0.05;
total = amount-discount ;
}