Search
 
SCRIPT & CODE EXAMPLE
 

C

Categorize students according to their marks

#include<stdio.h>
	#include<conio.h>
	void main() {
		int m,a,b,c,d,e,f,g,h,i;
		char ch;
		a=b=c=d=e=f=g=h=i=0;
		read:
			clrscr();
		printf("enter the Marks in range 0 - 100 
");
		scanf("%d", &m);
		/* use simple if statement */
		if(m>80) a++;
		if(m>60) b++;
		if(m>40) c++;
		if(m<=40) d++;
		/* use else if ladder ship */
		if(m>80) e++; else if(m>60) f++; else if(m>40) g++; else
				    h++;
printf("Any more Student <<y/n>> ?");
ch = getche();
if(ch =='y') goto read;
printf("
");
printf("Who have more then 80 Marks = %d
",a);
printf("Who have more then 60 Marks = %d
",b);
printf("Who have more then 40 Marks = %d
",c);
printf("Who have less or 40  Marks = %d
",d);
printf("Who have obtain in range 81 -100 = %d
",e);
printf("Who have obtain in range 60 - 80 = %d
",f);
printf("Who have obtain in range 40 - 60 = %d
",g);
printf("Who have obtain in range 0 -  40 = %d
",h);
getch();
}
Comment

PREVIOUS NEXT
Code Example
C :: c program boilerplate code 
C :: Reverse every Word of given String 
C :: switch every right 4 bit with the left 4 bits 
C :: gnuplot rectangle border color 
C :: C Common mistakes when working with pointers 
C :: peripheral bus clock pic32 
C :: networkx remove attributes 
C :: add last in list c 
C :: wap in c to input n numbers in an array, find out the sum of odd nos. and even nos. display the numbers whose sum is high. 
C :: wait system call 
C :: nc,manc 
C :: golang inline function definition 
C :: creating an array of arrays or 2D array dynamically 
C :: debian9 remove pack 
C :: time to apply pmfby 
C :: not repeated serial number in c 
C :: write to file in c programming 
C :: what is implicit typecasting 
C :: arrays c 
Dart :: flutter listtile shape border 
Dart :: dart math library 
Dart :: flutter rounded ElevatedButton 
Dart :: flutter replace character in string 
Dart :: remove space from string dart 
Dart :: flutter cliprrect 
Dart :: flutter linear progress indicator height 
Dart :: flutter espacio entre widgets 
Dart :: dart list to json 
Dart :: open another page with routeflutter 
Dart :: flutter bullet point 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =