Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to count number of student in 80 to 100, 60 to 80 and so on.range

Posted By: Curtis Willis     Category: C Programming     Views: 3903

Program to count number of student in 80 to 100, 60 to 80 and so on.range

Code for Program to count number of student in 80 to 100, 60 to 80 and so on.range in C Programming

#include<stdio.h>
#include<conio.h>

void main()
{
    int n,a[100],c1,c2,c3,c4,i;
    c1 = c2 = c3 = c4 = 0;
    clrscr();

    printf("Enter the number:-");
    scanf("%d",&n);

    printf("\nEnter marks of %d student\n",n);

    for(i=1;i<=n;i++)
    scanf("%d",&a[i]);

    for(i=1;i<=n;i++)
    {
        if(a[i] >= 80 && a[i] < 100)
        c1++;

        if(a[i] >= 60 && a[i] < 80)
        c2++;

        if(a[i] >= 40 && a[i] < 60)
        c3++;

        if(a[i] <= 40)
        c4++;
    }

    printf("\nStunent Whose Marks Between 80 And 100 Are :: %d ",c1);
    printf("\nStunent Whose Marks Between 60 And 80 Are :: %d ",c2);
    printf("\nStunent Whose Marks Between 40 And 60 Are :: %d ",c3);
    printf("\nStunent Whose Marks Less Then 40  Are   :: %d ",c4);


    getch();
}
/*
********
OUTOUT
********

Enter the number:-5

Enter marks of 5 student
45
56
77
88
12

Stunent Whose Marks Between 80 And 100 Are :: 1
Stunent Whose Marks Between 60 And 80 Are :: 1
Stunent Whose Marks Between 40 And 60 Are :: 2
Stunent Whose Marks Less Then 40 Are :: 1
*/
  
Share: 



Curtis Willis
Curtis Willis author of Program to count number of student in 80 to 100, 60 to 80 and so on.range is from Dallas, United States.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!