char choice, y, n; float percentage; int marks; printf("Do you want to know your percentage?(y/n):\n\n"); scanf(" %c", &choice); if (choice == 'y') { printf("Enter Your 2nd Sem Marks:\n\n"); scanf(" %d", &marks); percentage = (marks / 775) * 100; printf("Your 2nd Sem Percentage is %.2f", percentage); } else printf("Thankyou!!!!\n\n\n"); I can't calculate the percentage using the above code - I get output 0.00...
For example when i give input as 536,instead of showing result as 69.16,it shows 0.00 please help me out