c programming – result of Pass ATKT Fail of student

c programming – result of Pass ATKT Fail of student

In this post we will show you how to generate result of Pass ATKT Fail of student in c programming. flowing code will help you to perform program.

 // include header file 
# include <stdio.h>
# include <conio.h>
// main function
void main()
{
	int m1,m2,m3,m4,m5;
	int pass,fail;
	clrscr();

	printf("Enter m1: ");
	scanf("%d",&m1);
	printf("Enter m2: ");
	scanf("%d",&m2);
	printf("Enter m3: ");
	scanf("%d",&m3);
	printf("Enter m4: ");
	scanf("%d",&m4);
	printf("Enter m5: ");
	scanf("%d",&m5);

    pass=0;
	fail=0;

	if(m1>=40)
	  pass++;
	else
	  fail++;

	if(m2>=40)
	  pass++;
	else
	  fail++;

	if(m3>=40)
	  pass++;
	else
	  fail++;

	if(m4>=40)
	  pass++;
	else
	  fail++;

	if(m5>=40)
	  pass++;
	else
	  fail++;

	if(pass==5)
	  printf("\nPass");
	else if(pass>=3)
	  printf("\nATKA");
	else
	  printf("\nFAIL");

	getch();
}

Leave a Comment

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

  +  13  =  16

We accept paid advance and paid guest Posting on our Site : Contact US