c program to count no. of students who scored more than 50%

c program to count no. of students who scored more than 50%
c program to count no. of students who scored more than 50%

The logic to write a c program to count no. of students who scored more than 50%  of marks is: Store student marks in an array initialize count variable as zero. for each student calculate percentage if it is greater than 50% increment count

c program to count no. of students who scored more than 50% of marks

Write a c program to count no. of students who scored more than 50% of marks

# include <stdio.h>
# define Total_marks=100
main()
{
struct student
{
int marks;
}
student s1[5];
int i count =0;
printf(“To count no. of students who scored more than 50% of marks “)
for(i=0;i<25;i++)
{
printf(“\n Enter the marks of %d   :\n”,  s1[” i “]  );

scanf(“%d”,&s1[5]);
if (s1[i]>=(Total_marks/2))
count=count+1;
}
printf(“no. of students secured more than 50% is: %d \n”, count)
}

OUTPUT:

..To count no. of students who scored more than 50% of marks…

Enter the marks of s1[0]:
56
Enter the marks of s1[1]:
89
Enter the marks of s1[2:
34
Enter the marks of s1[3]:
98
Enter the marks of s1[4]:
32
no. of students secured more than 50% is: 3

Other programs:

Static variable scope
Register variable scope
External variable scope
Automatic variable scope
amicable number
Prime number
Perfect number
Palindrome number
Strong number
Find Factorial 
Biggest Number
Average of n numbers
decimal number to octal
decimal number to hexadecimal
decimal number to binary
simple interest
compound interest
Add sparce matrices
Add matrices
 file copying
Palindrome string
Reverse string
String length
Replace characters in string
substring or not using arrays
First occurrence of character in string
Last occurrence of character in string
Convert to uppercase
Convert to lowercase
Concatenate strings 
Compare strings
Generate Employee payslips
Count students scoring marks>50%
convert weight into grams

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *