Search
 
SCRIPT & CODE EXAMPLE
 

C

Print mark-sheet of students

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
/**
*	rl -> Roll No
*	s1 -> Subject1 Marks
*	s2 -> Subject2 Marks
*	s3 -> Subject3 Marks
*	t -> total
*	per -> percentage
*	nm -> name of student
*	div -> division
*/

void main() {
	/*variable declaration part */
	int rl,s1,s2,s3,t;
	float per;
	char nm[25],div[10];
	clrscr();
	/*reading part */
	printf("Enter the Roll No : ");
	scanf("%d",&rl);
	printf("Enter Name        : ");
	fflush(stdin);
	gets(nm);
	printf("Enter Three Subject Marks :
");
	scanf("%d%d%d",&s1,&s2,&s3);
	/* processing part */
	t=s1+s2+s3;
	per=t/3.0;
	if(per>=75)
	     strcpy(div,"Honour"); else if( per>=60)
		  strcpy(div,"First"); else if( per>=48)
			 strcpy(div,"Second"); else if (per>=36)
			     strcpy(div,"Pass"); else
			     strcpy(div,"Fail");
	/* display part */
	printf("		University of Rajasthan
");
	printf("

");
	printf("Roll No: %d 	  Name : %s
",rl,nm);
	printf("---------------------------------------------------
");
	printf("Subject             Max      Min            Obt.Marks
");
	printf("---------------------------------------------------
");
	printf("Hist                100      36              %d
",s1);
	printf("socio.              100      36              %d
",s2);
	printf("Hindi               100      36              %d
",s3);
	printf("---------------------------------------------------
");
	printf("				  Total          %d
",t);
	printf("per  %f			  div: %s 
",per,div);
	printf("---------------------------------------------------
");
	getch();
}
Comment

PREVIOUS NEXT
Code Example
C :: c to assembly converter 
C :: entity framework core discard changes 
C :: c program for calculating product of array 
C :: Highest integer among the four inputs in c 
C :: cocktail sort in c 
C :: how tier lists work 
C :: run steam as root 
C :: how can i learn c game development 
C :: install lib juicyPixel in haskell 
C :: Combine two sentences into one langage c 
C :: print integer to stdout using write or putchar? 
C :: OpenDaylight maven settings 
C :: Print Characters 
C :: buble sort in c that ask user input 
C :: python project script run 
C :: como hacer para que una salida en linux aparezca de poco en poco 
C :: Implement N-Queen Problem 
C :: timespec c 
C :: write the data in perticulare memmory loaction in C 
C :: arr+1 vs &arr+1 
C :: reap zombie process in c 
C :: np mean 2nd dimension 
C :: take array input from user and calc the avr in c 
C :: nosql injection 
C :: c constants 
C :: install zoom on ubuntu 
Dart :: dart string remove first character 
Dart :: flutter appbar width 
Dart :: dart timestamp 
Dart :: target of uri doesn 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =