MAIN C PROGRAMS

TO FIND EVEN OR ODD :

//header files
#include stdio.h
#include conio.h
    void main(){
    int num;
    clrscr();
    printf("ENTER A NUMBER:");
    scanf("%d",num);
    if(num%2 == 0) 
    printf("%d is even");
    else
    printf("%d is odd");
    getch();
}

CALCULATE STUDENT GRADE USING ELSE-IF LADDER:

#include stdio.h
#include conio.h
void main(){
    int s1,s2,s3,total;
    float per;
    clrscr();
    printf("ENTER SUBJECT MARKS:");
    scanf("%d%d%d",&s1,&s2,&s3);
    total=s1+s2+s3;
    per=total/3;
    if(s1>40 && s2>40 && s3>49)
    {
      if(per>90)
      printf("A GRADE");
      else if(per>70)  
      printf("B GRADE");
      else if(per>50)
      printf("C GRADE");
      else if(per>40)
      printf("D GRADE");
    }
    else
    printf("FAILED");
    getch();
}

MADE BY:SAMEERAZ