Hello to all,
I am new to this forum. I recently started learning c-language. I want to drop particular number? So example if there is number like 97, is there any way to drop 7 from 97. If anyone know how to do this then please help- me.
Thank you.
Hello to all,
I am new to this forum. I recently started learning c-language. I want to drop particular number? So example if there is number like 97, is there any way to drop 7 from 97. If anyone know how to do this then please help- me.
Thank you.
I have written following code for you. It is very simple one. just try this code in your computer. In the following code i have create one variable knows as answers.
int answers;
somy[265] { 0, ... 4, 2, 3, 3, 3, 3, 3, 3, 9, 9, 9, 10 ... 255 };
Answers = sommy[97];
You have to run use this code in your computer to get output.
Hello, I am not having more knowledge about the dropping the particular number in C++. But, while searching on internet I have got the code below which will help you to achieve it. So, just make use of it and get solution for you.
Code:#include <stdio.h> int Num[256]; int main () { for (int count=0; count<256; count++) { Num[count]=(count)*0.1; printf("Now you will move the decimal on the number %d one place to the left equals %d.\n", count, Num[count]); } return 0; }
Hey, this is quiet simple thing to do into the C++. You just need to make use of the line of the code below:
If you make use of the code below you would not able to get solution for your problem:Code:numbers[count]=count*0.1;
Code:numbers[count]=(count)*0.1;
You have to just use simple maths to solve this example. Suppose if you want to remove 7 from 97 then just subtract 90 from 97. You also have to move the decimal one place to the left and since its an integer the decimal is automatically dropped.
I think my suggestion will help you.
Hello, if you simply put the integer division by 10 on the number value then you will able to get the solution for your problem. So, just use it and solve your problem:
Code:int arr[256] = ... int num = 0; // get the num num /= 10; cout << arr[num] << endl;
Bookmarks