# Can someone check my work?

 Bugra Akyol · February 2, 2015 Can someone check my work? And if you have advices to make it better please tell me.ThanksWork link: http://www.eem.anadolu.edu.tr/tansufilik/B%C4%B0L%20200/duyuru/bil200_lab1_10_10_2014.pdfLAB WORK 1: Firstly, your program wants from user an integer (int) and two floating pointnumbers (f1,f2). After user enter all the inputs, If integer less than 0, your program should compares f1 and f2 and write the result as convenient one of the following:“ Valuef1 is greater than Valuef2 ”“ Valuef2 is greater than Valuef1 ”“ Valuef1 is equal to Valuef2 ” Note: Max 3 digits for fractional part of floating point numbers ? If 0 ? int ? 10, your program should want name and surname (max 15 character for each) from the user and print on the screen as following:“ Name = ……………….”“Surname = …………….”If int > 10,your program should print the message “Valueint is greater than 10” And finally your program should calculate the average of the entered numbers (integer and floating point numbers) and print on the screen as following:“The average of the entered number = ….”My code:``#include #include #include int main(){ int a; float f1,f2,avg; char name[15]; char surname[15]; printf("Enter an integer and two floating point numbers: \n"); scanf("%d %f %f", &a, &f1, &f2); if(a<0){ if(f1>f2){ printf("%.3f is greater than %.3f\n", f1, f2); }else if(f2>f1){ printf("%.3f is greater than %.3f\n", f2, f1);; } else{ printf("%.3f is equal to %.3f\n", f1, f2); } }else if(0<=a && a<=10){ printf("Enter name: \n"); scanf("%s",name); printf("Enter surname: \n"); scanf("%s",surname); printf("\"Name= %s\"\n\"Surname= %s\"\n",name,surname); }else{ printf("%d is greater than 10\n",a); } avg=((float)a+f1+f2)/3; printf("\"The average of the entered numbers= %.3f\"",avg); return 0; }``

## Replies

 osh Ranw · February 2, 2015 screen- Bugra Akyol · February 2, 2015 @c student 17? J show · February 8, 2015 I'll have to check it out my lab was creating the factorial function and applying it and then creating a reverse number function and applying it in the main function this week. Bugra Akyol · February 5, 2015 @Josh ShowalterJosh ShowalterIts my universities working page. I am not taking the lesson right now. But trying to learn before..You can find the other works on http://www.eem.anadolu.edu.tr/Ders.aspx?dersId=97 Check it out Bugra Akyol · February 3, 2015 @c student I thought +1 for storage so 17. I am not sure J show · February 3, 2015 Whats your course title? I'm taking a C programming class right now as well. The program look similar to what we've been doing.
• 1

## C

122,745 followers