void main ()
{
int no1, sum, n;
clrscr()
sum = 0;
n = 1;
printf("\n enter the number to which sum is to be generated");
scanf("%d",&no1);
while(n<=no1)
{
sum=sum+n;
n=n+1
}
printf("\n the sum of %d = %d, no1, sum");
getch ();
}
In a C program that calculates the factorial of a number using a function, the program typically prompts the user for an integer input. The function then recursively or iteratively computes the factorial by multiplying the number by the factorial of the number minus one until it reaches one. For example, if the user inputs 5, the program outputs 120, as 5! = 5 × 4 × 3 × 2 × 1. The final result is displayed on the screen.
The number of function is Geometry
program to find maximum of two numbers using pointers
C:#includeint main(){int num,sum,avg=0,i;printf("enter a number");scanf("%d",&num);for(i=0;i
int sum(n) { if (n==0) return 0; else return n+sum(n-1); }
Math.sqrt(number) function is used to find the square root of a number.. try it
There will be a function in it like this: double RectangleArea (double a, double b) { return a*b; }
If it contains a decimal point or an exponential part, then it should be handled as a float (or double).You can determine an existing variable's type in C using the type() function
It will find a number - if the number is not a formula. For example - if you search for the number 30 it will find it - BUT - if the product in a cell is the result of a formula it will disregard it.
Write a C program called MonthDays to find the number of days in a given month Test your code with different input values to demonstrate that your function is robust?
template<class T> T& max(const T& x, const T&y){return(x>y?x:y); }
The number of function is Geometry
program to find maximum of two numbers using pointers
Here is an example program: class obj{ public: float p,n,r,si; friend void calc( obj temp); }; void calc( obj temp){ si = (p*n*r)/100; } The initialization and function calling is essential.
Yes there are agent functions that can not be implemented e.g. an agent can not find the largest prime number.
//C program to find the factorial of a given number using functions #include<stdio.h> #include<conio.h> int fact(int); void main() { int f,t; clrscr(); printf("\nEnter any number:"); scanf("%d",&f); t=fact(f); printf("1=%d",t); getch(); } int fact(int fa) { int i,fac=1,t; for(i=fa;i>=2;i--) { // TO print the series printf("%dx",i); fac=i*fac; } return fac; }
The greatest number is infinity.