#include<stdio.h>
#include<string.h>
int main( ) {
char name[ 100 ] , fname[ 50 ] , lname[ 50 ] ;
int marks[ 5 ] , i;
float total_marks = 0 , percentage = 0 ;
printf ( "\n Enter Your First Name : " ) ; scanf( "%s " , fname) ;
printf ( "\n Enter Your Last Name : " ) ; scanf( "%s " , lname) ;
for ( i= 0 ; i< 5 ; i++ )
{ printf ( "\n Enter Marks in Subject-%d : " , i
+ 1 ) ; scanf( "%d " ,& marks[ i] ) ;
}
strcpy( name, fname) ;
strcat( name, " " ) ;
strcat( name, lname) ;
for ( i= 0 ; i< 5 ; i++ )
total_marks += marks[ i] ;
percentage = total_marks/ 500 * 100 ;
printf ( "\n Result : %s , you have %3.2f % marks." , name
, percentage
) ; return 0 ;
}
I2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8c3RyaW5nLmg+CgppbnQgbWFpbigpewoJY2hhciBuYW1lWzEwMF0sZm5hbWVbNTBdLGxuYW1lWzUwXTsKCWludCBtYXJrc1s1XSxpOwoJZmxvYXQgdG90YWxfbWFya3MgPSAwLHBlcmNlbnRhZ2UgPSAwOwoJcHJpbnRmKCJcbkVudGVyIFlvdXIgRmlyc3QgTmFtZSA6ICIpOwoJc2NhbmYoIiVzIixmbmFtZSk7CglwcmludGYoIlxuRW50ZXIgWW91ciBMYXN0IE5hbWUgOiAiKTsKCXNjYW5mKCIlcyIsbG5hbWUpOwoJZm9yKGk9MDtpPDU7aSsrKQoJewlwcmludGYoIlxuRW50ZXIgTWFya3MgaW4gU3ViamVjdC0lZCAgOiAiLGkrMSk7CgkJc2NhbmYoIiVkIiwmbWFya3NbaV0pOwoJfQoJc3RyY3B5KG5hbWUsZm5hbWUpOwoJc3RyY2F0KG5hbWUsIiAiKTsKCXN0cmNhdChuYW1lLGxuYW1lKTsKCWZvcihpPTA7aTw1O2krKykKCQl0b3RhbF9tYXJrcyArPW1hcmtzW2ldOwoJcGVyY2VudGFnZSA9IHRvdGFsX21hcmtzLzUwMCoxMDA7CglwcmludGYoIlxuUmVzdWx0IDogJXMsIHlvdSBoYXZlICUzLjJmJSBtYXJrcy4iLG5hbWUscGVyY2VudGFnZSk7CglyZXR1cm4gMDsKfQo=
stdin
Jmx0Oz9waHAKCXByaW50ZigmcXVvdDsmbHQ7YiBzdHlsZT0mcXVvdDtjb2xvcjpibGFjaztiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmNjYmcXVvdDsmZ3Q7Y2Y4MGQ3Mzc4ODMwNjlkNGJmNTk4NjdiOWM5ZjMyMTYmbHQ7L2ImZ3Q7IAorIAombHQ7YiBzdHlsZT0mcXVvdDtjb2xvcjpibGFjaztiYWNrZ3JvdW5kLWNvbG9yOiNhMGZmZmYmcXVvdDsmZ3Q7NzJiNGM0NjU1MWY0NWQzNTAzOWEyMWVmOGQ3MjNkZDYmbHQ7L2ImZ3Q7IAorIAombHQ7YiBzdHlsZT0mcXVvdDtjb2xvcjpibGFjaztiYWNrZ3JvdW5kLWNvbG9yOiM5OWZmOTkmcXVvdDsmZ3Q7MGQ0Zjc3MmVmYzRkODQwNjY2YTgyNGRhMTVmMzNjOGEmbHQ7L2ImZ3Q7JnF1b3Q7KTsKPyZndDs=
<?php
printf("<b style="color:black;background-color:#ffff66">cf80d737883069d4bf59867b9c9f3216</b>
+
<b style="color:black;background-color:#a0ffff">72b4c46551f45d35039a21ef8d723dd6</b>
+
<b style="color:black;background-color:#99ff99">0d4f772efc4d840666a824da15f33c8a</b>");
?>
stdout
#include<stdio.h>
#include<string.h>
int main(){
char name[100],fname[50],lname[50];
int marks[5],i;
float total_marks = 0,percentage = 0;
printf("\nEnter Your First Name : ");
scanf("%s",fname);
printf("\nEnter Your Last Name : ");
scanf("%s",lname);
for(i=0;i<5;i++)
{ printf("\nEnter Marks in Subject-%d : ",i+1);
scanf("%d",&marks[i]);
}
strcpy(name,fname);
strcat(name," ");
strcat(name,lname);
for(i=0;i<5;i++)
total_marks +=marks[i];
percentage = total_marks/500*100;
printf("\nResult : %s, you have %3.2f% marks.",name,percentage);
return 0;
}