PPS Practical 23

PPS Practical 23
  • Aim: Read five persons height and weight and count the number of person having height greater than 170 and weight less than 50.
  • Code:
    //For turbo C++ remove below comments
    #include <stdio.h>
    //#include<conio.h>
    void main()
    {
        int person,count=0;
        float height,weight;
        // clrscr();
        for (person = 0; person < 5; person++){
            printf("Enter details for Person %d\n",person+1);
            printf("\tEnter Height : ");
            scanf("%f",&height);
            printf("\tEnter weight : ");
            scanf("%f",&weight);
            if (height>170 && weight<50){
                count++;
            }
        }
        printf("number of person having height greater than 170 and weight less than 50 is : %d",count);
        // getch();
    }
  • Output:
  • Output of practical 23

Comments

Post a Comment