• Register
search
Log In

Recent questions tagged function

1 vote
1 answer 14 views
Problem: Hello guys, I am trying to run on of my simple Python program. The program simply defines a function and prints the returned value from the function. As far as my knowledge is concerned, the program should run without any error, but it is saying “ ... ) Could you please, have a look at this above program and find the issue? I look forward to having a solution from you.
asked Jun 30 adamSw 9.5k points
0 votes
1 answer 11 views
Problem: Hello guys, I was learning the function in python, and wondering can we use function within a function then I google some stuff then got to know that function within the function is better way of implementing the algorithm we are implementing, can you guys please show it with an example.
asked Jun 5 Gavin 15.2k points
1 vote
1 answer 9 views
Problem: Hello Kodlogs, I’ve got a simple user-defined function that adds two numbers. The script looks something like this: def is_a_function(a,b): var = 10 return (a+b)*var print(is_a_function(5,6)) The above program is doing good this way. I am thinking to ... have an idea how to run the function from the command line and I am wishing an example from you, guys. Thanks for your concern.
asked Jun 2 adamSw 9.5k points
1 vote
1 answer 12 views
Problem: What is an undefined reference to a function in c++ programming? I have been trying to calculate some values using my user-defined function in my program for hours. My simple c++ program is not producing the output as it is supposed to do instead of that encountering an error of: ... << "Substracted value is :" << subResult << endl; return 0; } int sum(int a, int b){ return a + b; }
asked May 29 adamSw 9.5k points
1 vote
1 answer 13 views
Problem: I am trying to create functions and use them in my c++ codes. I have created a function to add to integer numbers in a function. But the function is not working as it is supposed to do. I am attaching the code snippet below. Below have a look at my code and fix the ... int sum(int a, int b) { int result; result = a + b; return (result); } Please note that I am a newbie in programming.
asked May 29 adamSw 9.5k points
1 vote
1 answer 19 views
Problem: Hi all, I am a beginner in C++ programming. I am reading and trying to learn the C++ functions. Let say, I have a two-dimensional array and I want the values to be printed via a function call. How to do that in C++? I&rsquo;ve given a ... format to do that? If not, please share your suggestions and ideas with me. I am looking forward to reading your comments eagerly. Thanks, guys.
asked May 10 adamSw 9.5k points
1 vote
1 answer 14 views
Problem: Hello Experts, Well, I am looking for a simple solution. My problem might be silly to you guys but this thing driving me crazy so far. I&rsquo;ve bought an online course to learn C++ programming out of curiosity. Till this day I was doing good. I&rsquo; ... program that calls a function from another file. I mean, what is this? Could you please help out? I must recognize your help. Thanks.
asked May 3 Gavin 15.2k points
1 vote
1 answer 9 views
Problem: Hello, I am pretty much novice in this programming world. I have started learning C programming a few days back. I am taking an online course. Today we learned a few things about functions and its prototyping. I am trying to solve a ... error: too few arguments to function multiply_two_numbers' multiply_two_numbers(); I am looking forward to having a legit solution. Thanks, mate.
asked Apr 26 Gavin 15.2k points
1 vote
1 answer 29 views
Problem : I am very new to Vanilla JavaScript. Currently I am learning Vanilla JavaScript as I need to use the Vanilla JavaScript for my current project. I have already written many functions one of them has a button in it which should open the menu and it only ... spent a lot of time in fixing target id issue so looking for Vanilla JavaScript experts help who can suggest quick fix on above error.
asked Apr 23 stewart 4k points
1 vote
1 answer 14 views
Problem: Hello, kodlogers, I am writing codes in C/C++ nowadays. My code is about to add two numbers. I want to add those numbers by calling a function inside my may main function. But the program is not running for some reason. It&rsquo;s saying Error: too many arguments in function call What ... int y) { int z; z = x + y; printf ("%d\n", z); } Thanks guys for your kind help and pulling me out.
asked Apr 11 Gavin 15.2k points
1 vote
1 answer 34 views
Problem : I am very new to Matlab. I have written below code in my .M file: function f = piecewise(w, C) S=sqrt(diag(diag(C))); s=diag(S); f=sqrt(w'*C*w)/(w'*s); I have already stored my file (piecewise.M) in my normal Matlab path, ... , C) I start facing below error. &ldquo;Undefined function 'piecewise' for input arguments of type 'double'.&rdquo; Can you please help me in fixing above error?
asked Apr 4 morrisBson 3.2k points
1 vote
2 answers 26 views
Problem: I am new in programing and and I am confused about python function names follow the same rules for naming variables. Can anyone explain?
asked Apr 3 LizzyM 5.7k points
1 vote
1 answer 25 views
Problem: Hello Kodlogs, I am going through a problem for the last few minutes. I tried to solve it in many ways but still couldn&rsquo;t get rid of this. I&rsquo;ve learning c++ programming language from last week. So, you can treat me as a novice in it. I have a ... (addr,retstring().c_str()); And the function I tried to call: void Printfunc(int a, char *loc, char *stream) Thanks. Good day!
asked Mar 29 Gavin 15.2k points
2 votes
1 answer 31 views
Problem: I am new in python programming so I am always confused about what is going wrong with my code. Recently I write a code: class showInformation(object): def __int__(self, name, age): self.name = name self.age = age def showName(self): ... showInformation("XXX") TypeError: showInformation() takes no arguments typeerror: object() takes no parameters Whats wrong In my code can anyone explain?
asked Mar 24 LizzyM 5.7k points
1 vote
2 answers 35 views
Problem: Hello fellas, I was trying to solve problems from various websites. All the problems are the java-based problem. I&rsquo;ve got a problem that says: Write the definition of a class weatherforecast that provides the following behavior (methods): A method called setSkies that ... has one parameter, an int So, the challenge is, I can only have those methods in my program. Do you any clue?
asked Mar 22 Gavin 15.2k points
1 vote
1 answer 130 views
Problem: Hello Pal, I have a query regarding the python programming language. The question is, which method will return an empty string when it has attempted to read beyond the end of a file? Do you have any idea about this? Thanks
asked Mar 16 Gavin 15.2k points
1 vote
1 answer 17 views
Problem: I am an intermediate level java programmer, and I can write codes in java bit fluently. Recently, I am learning code in python. If anybody could tell me how can I return multiple values in python it would be very helpful to me. I know the ways how to do it in java but not in python. Thanks
asked Mar 10 Gavin 15.2k points
1 vote
1 answer 16 views
Problem: I simply want to know what is the Scope of variables in c++, and why the program throws back errors like, &ldquo;c++ was not declared in this scope&rdquo;? Please keep your words as simple as possible. Thanks.
asked Mar 10 Gavin 15.2k points
1 vote
2 answers 322 views
Problem: I recently started learning python programming. This is my very first attempt to write a code run the program. I tried to compile my program but it throwing me back an error. def multiply(a, b): a * b What should I do now?
asked Mar 9 Gavin 15.2k points
0 votes
2 answers 29 views
Problem: Which ordered pair maximises the objective function P = 3x + 8y? (0, 0) (2, 7) (5, 6) (8, 1)
asked Mar 9 ArifulIslam 5k points