C language interview questions solution for freshers beginners placement tricky good pointers answers explanation operators data types arrays structures functions recursion preprocessors looping file handling strings switch case if else printf advance linux objective mcq faq online written test prime numbers Armstrong Fibonacci series factorial palindrome code programs examples on c++ tutorials and pdf
Subscribe to:
Post Comments (Atom)
1 comment:
there is an error in your algorithm.so the answer is wrong.
the should be like this ..,
//Spending money on fooding
fooding = (total_salary * 30)/100;
//Spending on clothing
clothing = (total_salary*10)/100;
//spending on other work
other = (total_salary*15)/100;
//According to question
total_salary = fooding + clothing + other + 10000
total_salary = (total_salary * 30)/100 + (total_salary*10)/100 + (total_salary*15)/100 + 10000
total_salary(1 -30/100 - 10/100 - 15/100) = 10000
total_salary = 10000/(1-30/100-10/100-15/100)
/* program expression is ..*/
#include
int main(){
float total_salary;
total_salary = 10000.0/(1-30.0/100-10.0/100.0-15.0/100);
printf("%f",total_salary);
return 0;
}
Answer : 22222.22
Post a Comment