answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

int func(void);

void main(void)

{

clrscr();

printf("Enter five digit number: ");

printf("nnnSum of entered number is %d",func());

getch();

}

int func(void)

{

int b=0,a;

while((a=getche())!='r')

b+=a-=48;

return b;

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Write function integerpower that return the value of base exponent?

write a scripting to return values in functions


How do you write exponents in Java?

You can use the Math.pow function to raise one number to the power of another. Math.pow(24, 3) will return 243


How do you Write a program in 'c' language which accepts int numbers from the users print its reverse number x function which return value?

question clarity


Write a c program for function with no arguments and no return values?

void mynullfunction () {;}


Write a program to return a function using class in C Plus Plus?

Classes cannot return values, only functions can return values. But you cannot return a function from a function, you can only return a function pointer -- a pointer variable holding the address of the function you wish to return. All possible return values must be of the same type, therefore all function signatures and return types must be exactly the same -- only the name of the functions can differ.


write a pseudocode to accept a number and find if it is prime or not?

Yes


Can you write a program without specifying the prototype of any function?

You can write a program without specifying its prototype when the function returns an integer.If the prototype is not mentioned the compiler thinks that the return type of the function used is integer.When making program which return integer you can ignore writing the protoype.


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); }


How do you write a program to factorial in PHP?

To write a program that calculates the factorial of a number in PHP, you can use a recursive function or an iterative approach. Here’s a simple example using a loop: function factorial($n) { $result = 1; for ($i = 2; $i &lt;= $n; $i++) { $result *= $i; } return $result; } echo factorial(5); // Outputs: 120 This code defines a function that multiplies numbers from 2 up to the given number $n to compute the factorial.


How you write a c program for making a call in gcc?

int main() { // Call the printf function printf("This is a function call!\n"); return 0; }


How do you write a c program to find area of rectangle using function?

There will be a function in it like this: double RectangleArea (double a, double b) { return a*b; }


What is meant by functions on python?

Python programming allows you to write your own programs. For example, to write a function named double that returns the number that you input, but doubled, we would write the following (where &gt;&gt;&gt;&gt; indicates a tab space) def double(x): &gt;&gt;&gt;&gt;x=x*2 &gt;&gt;&gt;&gt;return x