Google analytics

Wednesday, September 7, 2011

Program to find the Grade of the marks

/* Program to find the Grade of the marks */


#include<stdio.h>
#include<conio.h>
int main()
{
 int m;
 clrscr();
  printf("Enter The Marks : ");
  scanf("%d",&m);
 if
 (m>=90 && m>=80)
  printf("Grade is A!");
 else if
 (m>=80 && m>=70)
  printf("Grade is B!");
 else if 
 (m>=70 && m>=60)
  printf("Grade is C!");

 else if 
 (m>=60 && m>=50)
  printf("Grade is D!");
 else if 
 (m>=50 && m>=40)
  printf("Grade is E!");

 else if 
 (m>=40 && m>=33)
  printf("Grade is F!");
 getch();
}






Write a program to check whether a given number is even or odd

/* check whether a given number is even or odd   */

#include<stdio.h>

#include<conio.h>
int main()
{
int a;
printf("Enter number : \n");
scanf("%d",&a);
if
(a % 2 ==0)
printf("The given number is EVEN\n");
else
printf("The given number is ODD");
return0;
}

Salary of a Company

/*  Salary Bonus */


#include<stdio.h>
#include<conio.h>
main()
{
   int a,b=500;
   float c;
    printf(“Enter the salary = “);
    scanf(“%d”,&a);
   if
   (a>=b)
  c=a*0.05
    printf(“Bonus is = %d”,c);
  else
    printf(“Bonus is = 250”)
}