answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>main()

{

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a function prime that return 1 if its argument is a prime and returns 0 otherwise?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

In C programming Write a function that returns 1 if its argument is a prime number and returns zero otherwise?

#include&lt;iostream.h&gt; int CheckPrime(int number){ for(int i=2;i&lt;number;i++){ if(number%i==0) return 0; } return 1; } void main() { int num=7; cout&lt;&lt;CheckPrime(num); }


What statement returns a value from a function?

return


What is return in programming?

The return statement is used in functions to return control to the caller. If the function is declared non-void, the return statement also allows the programmer to return a value to the caller.


Where do you use no argument no return in c function?

Where there is no need to return any type of value from a function


What module returns a value back to the part of the program that called it?

A function. You can have a function that returns but doesn't return a value with it.


What does sqrt function return?

square root of the argument


An argument takes a value or values and performs an operation?

In programming, an argument takes a value or vales and performs an operation is called a function or method. If a method does not return a value, it is described as 'void'.


What is a variable that is used within a function?

If the variable is declared within the function body, it is a local variable, one that is local to the function. Local variables fall from scope when the function returns, they are only accessible within the function. However, local variables can be returned by value, which creates an automatic variable that is returned to the caller. If the caller does not store the return value, the automatic variable falls from scope when the expression containing the function call ends. However, the expression may evaluate the return value without storing it. Note that functions cannot return local variables by reference since the local variable falls from scope when the function returns. If the variable is passed as an argument to the function, then the variable is a parameter of the function. Arguments may be passed by value or by reference, depending upon the function signature. Passing by value means the function parameter is a copy of the argument (if the argument is an object, the object's copy constructor is invoked automatically). Thus any changes made to the parameter within the function are not reflected in the argument that was originally passed, and the parameter will fall from scope when the function returns. However, the value of the parameter can be returned as previously explained. Passing by reference means the function parameter refers directly to the argument that was passed. Thus any changes made to the parameter are reflected in the argument. Parameters that are declared as constant references assure the caller that the reference's immutable members will not be altered by the function. If the parameter is a non-const reference but the caller does not wish changes to be reflected in the argument, the caller should pass a copy of the argument instead.


Difference between sizeof and strlen?

The sizeof operator returns the total size, in bytes, of the given operand, whereas the strlen function returns the number of characters in the argument up to but not including the first null-terminator.Consider a character buffer allocated 50 bytes to which you assign the string "Hello world". The sizeof operator will return 50, but the strlen function returns 11.


What is different between a subroutine and function in vb.net?

Function returns a value but sub procedure do not return a value.


What part of a function definition specifies the data type of the value that the function returns?

The function header. The return value is written before the name of the function. This return type must match the type of the value returned in a return statement.


Function gets returns?

Yes, it does return. There are only few functions that do not return, like exit, exec, longjmp.