Please correct me i am not getting the value of z in output | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please correct me i am not getting the value of z in output

#include <stdio.h> int main() { int sci,maths,comp; char name[20]; scanf("%20s",name); printf("Result of mr/mrs %s \n",name); scanf("%5d",&sci); printf("The mark of Science = %d \n",sci); scanf("%5d",&maths); printf("The mark of maths = %d \n",maths); scanf("%5d",&comp); printf("The mark of computer = %d \n",comp); int a = sci+maths+comp; if(a < 300){ int z = a/300*100; if(z >= 40) printf("He/she have passed the test with the percent of = %d",z); else printf("He/she have failed the test with the percent of = %d",z); } else if(a == 300) printf("He/she have got 100 percent in his/her test"); else printf("Marks of oone of the subject must be exceded the limit. please try it again"); return 0; }

5th Dec 2020, 1:45 PM
Dipraj
Dipraj - avatar
1 Answer
+ 1
Thank you miss pallavi for your help๐Ÿ‘๐Ÿ‘
6th Dec 2020, 1:05 AM
Dipraj
Dipraj - avatar