CategoryProgramming

Finding Factorial of a number using Recursion

F

Recursive Function : Recursive function is a type of function which calls itself in Function Definition Code Segment until a terminating condition reached. In the following program “fact( )” is a recursive function. Use long int in place of int to find factorial of large number like 100 or so on. The power of recursion evidently lies in the possibility of defining an infinite set of...

Pointers in programming

P

When we declare a variable in C/C++ etc. by statements like int a or int b , it tells the compiler to reserve the space of two bytes in the memory to store the integer type value and identify the storage location in the memory by ‘a’ or ‘b’ etc. So every variable has three properties 1. Identifier (Name like a or b) 2. Value(a=10 or b=15 etc) 3. Its address (hexadecimal)...

C++ program to find the length of user entered string

C

A Simple C++ program to find the length of user entered string.In this program we have used the two properties of Strings 1. The terminating character or end of string marker ‘\0’ and the special property of character array in which character identifier represents the address of first element of the character array(i.e string). #include <iostream.h> #include <conio.h>...

Convert the Decimal into Binary equivalent.

C

A Simple C Program to Convert the Decimal into Binary equivalent. We have used a While loop, Modulus(%) and Division(/) operator . We have used an Array “ar” to store the Binary Output(remainder) for proper formatting of output. #include int main() { int a=0,b=0,n,i=1,j,k=0; int ar[10]={0,0,0,0,0,0,0,0,0,0}; printf("\n Enter the decimal number"); scanf("%d",&amp;amp;amp;n);...

Your sidebar area is currently empty. Hurry up and add some widgets.