Showing posts with label while loop. Show all posts
Showing posts with label while loop. Show all posts

Thursday, September 27, 2012

Doubly Linked Lists Implementation using oops of c plus plus | Data Structure

Doubly Linked Lists Implementation using oops of c plus plus | Data Structure

Doubly Linked Lists Implementation using oops of c plus plus | Data Structure
By Sanjay Sinalkar
Write a program in c++ using object oriented concept to create Double Linklist which having following functionality 

1)Insert element at Begin
2)Insert element at given position
3)Insert element at End
4)Delete element from Begin
5)Delete element From End
6)Delete element from Given position
 7) Show all element Inserted in Display function()
Program should validate given position before calling given position operation such as Insert or Delete

Sunday, September 2, 2012

Factorial of a Number Using While loop in C program

Factorial of a Number Using While loop in C program

This is program to find out factorial of a number using simple while loop. this logic use to create a function like fact to find out any factorial of number /Integer.

/* Program For Factorial Of a No.*/
#include<stdio.h>

int main()
{
int no,temp=1;
printf("\nEnter no\n");
scanf("%d",&no);

int fact=1;
while(1)
{
if(temp>no)
 break;
fact=fact*temp;
temp++;
}

printf("Factorial of No    %d \t is :%d\n",no,fact);
return 0;


}