Please convert the code toC Language
#include using namespace std;//comparing goodness of hash function 1 & 2int main(){ //set of input numbers vector arr{ 12345, 234245, 1223123, 765845, 345234, 234534, 98675, 34523, 123, 3245 }; //using hash function 1 cout < "using="" hash="" function=""> for (int a : arr) { cout < a="">< "-="">" < to_string(a).length()="" %="" 10=""><> } //using hash function 2 cout < "\n\nusing="" hashh="" function=""> for (int a : arr) { cout < a="">< "-="">" < (rand()="" *="" a)="" %="" 10=""><> } return 0;}Output:Extracted text: using hash function 1 12345->5 234245->6 1223123->7 765845->6 345234->6 234534->6 98675->5 34523->5 123->3 3245->4 using hashh function 2 12345->9 234245->4 1223123->3 765845->-1 345234->-4 234534->4 98675->6 34523->0 123->5 3245->-9
//comparing goodness of hash function 1 & 2int main(){
//set of input numbers vector arr{ 12345, 234245, 1223123, 765845, 345234, 234534, 98675, 34523, 123, 3245 }; //using hash function 1 cout < "using="" hash="" function=""> for (int a : arr) { cout < a="">< "-="">" < to_string(a).length()="" %="" 10=""><> } //using hash function 2 cout < "\n\nusing="" hashh="" function=""> for (int a : arr) { cout < a="">< "-="">" < (rand()="" *="" a)="" %="" 10=""><> } return 0;}Output:Extracted text: using hash function 1 12345->5 234245->6 1223123->7 765845->6 345234->6 234534->6 98675->5 34523->5 123->3 3245->4 using hashh function 2 12345->9 234245->4 1223123->3 765845->-1 345234->-4 234534->4 98675->6 34523->0 123->5 3245->-9
//using hash function 1 cout < "using="" hash="" function=""> for (int a : arr) { cout < a="">< "-="">" < to_string(a).length()="" %="" 10=""><> }
//using hash function 2 cout < "\n\nusing="" hashh="" function=""> for (int a : arr) { cout < a="">< "-="">" < (rand()="" *="" a)="" %="" 10=""><> }
return 0;}
Output:
Extracted text: using hash function 1 12345->5 234245->6 1223123->7 765845->6 345234->6 234534->6 98675->5 34523->5 123->3 3245->4 using hashh function 2 12345->9 234245->4 1223123->3 765845->-1 345234->-4 234534->4 98675->6 34523->0 123->5 3245->-9
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here