![]() ![]() ![]() If you are going to compare the array suspect with elements of the two-dimensional array criminals you should use one more inner for loop. So the compiler issues the error message. credit.c:45:22: error: invalid operands to binary expression ('double' and 'double') odd (number (pow (10, i)) - number (pow (10, i-1)) / pow (10, 15) I managed this problem by determining a new variable long long powodd and multiplying instead of powering. That is there are compared an object of the type float with a pointer of the type float * that does not make a sense. The expression criminals is implicitly converted to the type float * because the original type of the expression before the conversion is float.Īnd moreover the expressions suspect has the type float. ![]() In this if statement if(suspect != criminals) //Error is in this line Printf("Enter the 10 chromosomes of the suspect separated by spaces: \n") ![]() Read 10 input values into suspect array from keyboard Here is my code… #include įloat suspect //Declaring suspect arrayįloat criminals //Declaring criminals array I’ve been scanning and looking for a problem but nothing seems to fix it. Write a program that asks for the principal, the interest rate, and the number of times the interest is compounded.In my first year University class we have just started fiddling with arrays and on the worksheet I was given this code, which doesn’t seem to work. But, when I tried to install it (with the desktop application with C workload), it turns out it takes a lot of memory (it needs 5GB and my laptop only has 15GB of memory left lol) and it seems over the top than for what I wanna do. I found out that VS is the most used and recommended IDE to use for C . Principal is the balance in the savings account, Rate is the interest rate, and T is the number of times the interest is compounded during a year (T is 4 if the interest is compounded quarterly). I wanna learn C for competitive programming. Copy Code #include #include using namespace std Ĭout < < " The total amount is : " < < amount < < endl Īssuming there are no deposits other than the original investment, the balance in a savings account after one year may be calculated as ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |