Neeraj Mishra

A crazy computer and programming lover. He spend most of his time in programming, blogging and helping other programming geeks.

C++ Hotel Management Project

Here you will get C++ hotel management project. This system provides various options like booking a room, checking customer details, editing or deleting any customer, checking all allotted rooms. The project is developed using two important C++ concepts that are classes and file handling. C++ Hotel Management Project #include<iostream.h> #include<conio.h> #include<fstream.h> #include<stdio.h> #include<dos.h> class hotel …

C++ Hotel Management Project Read More »

Program to Reverse Number in C

Here you will learn how to reverse number in C. #include<stdio.h> int main() { long n,rev=0,d; printf(“Enter any number:”); scanf(“%ld”,&n); while(n!=0) { d=n%10; rev=(rev*10)+d; n=n/10; } printf(“The reversed number is %ld”,rev); return 0; }   Output Enter any number:16789 The reversed number is 98761

Program to Reverse Number in C++

Here you will get program to reverse number in C++. #include<iostream> using namespace std; int main() { long n,rev=0,d; cout<<“Enter any number:”; cin>>n; while(n!=0) { d=n%10; rev=(rev*10)+d; n=n/10; } cout<<“The reversed number is “<<rev; return 0; }   Output Enter any number:12674 The reversed number is 47621

C++ program to print the following pattern:

#include<iostream.h>#include<conio.h>void main(){ clrscr(); //to clear the screen int i,j,k,n; cout<<“How many lines?”; cin>>n; n*=2; for(i=0;i<n;i+=2) { cout<<“n”; for(j=n;j>i;j-=2) cout<<” “; for(k=0;k<=i;++k) cout<<“*”; } getch(); //to stop the screen}