Skip to content
logo
  • Home
  • C
    • Programs
    • Tutorials
    • Interview Questions
  • C++
    • Programs
    • Tutorials
    • Interview Questions
  • Java
    • Programs
    • Tutorials
    • Interview Questions
  • Android
  • Python
    • Tutorials
    • Programs
    • Interview Questions
    • Django Tutorials
  • .Net
    • C#
    • VB.Net
      • Tutorials
      • Interview Questions
    • ASP.NET
  • PHP
  • Batch File
  • JavaScript
  • SQL
  • PL/SQL
    • Tutorials
    • Programs
    • Interview Questions
  • Programming
    • Articles
    • Tutorials
    • Projects
  • Interview Q & A
  • Books
  • DSA
  • Design
    • Design
    • HTML Interview Questions
  • Development
  • Review
  • Sponsored
  • Tools
logo

C++ program to find cube of a number using macros

Simple

Also Read: C++ program to swap two numbers using macros Also Read: C++ Program to find cube of a number using function #include<iostream.h> #include<conio.h> #define CUBE(x) (x*x*x) void main() { clrscr(); int n,cube; cout<<“Enter a number:”; cin>>n; cube=CUBE(n); cout<<“Cube=”<<cube; getch(); }

C++ program to find cube of a number using macros Read More »

C/C++ Program to Create a Digital Stopwatch

Projects

Hello friends, this is a simple program to create a digital stopwatch. I am sure that even a beginner can understand it very easily. I have written this in c++, so to use it c just change all cout statements with corresponding printf statements. I hope you understand what i want to say. If you

C/C++ Program to Create a Digital Stopwatch Read More »

C program to count number of words in a string

String

#include<stdio.h> #include<conio.h> void main() { int i,words=1; char str[100]; clrscr(); printf(“Enter a string:”); gets(str); for(i=0;str[i]!=’’;++i) if(str[i]==’ ‘) words++; printf(“No. of words are %d”,words); getch(); }

C program to count number of words in a string Read More »

How to create your own Header Files in C/C++?

Tutorials

In this article I am going to tell you the easiest way to create your own header files in programming languages like C and C++. For this you do not have to be an expert. This can be done by anyone who has just started learning programming languages. Ok! Before starting the process let me

How to create your own Header Files in C/C++? Read More »

C++ program to swap two numbers using pointers

Pointer

#include<iostream.h> #include<conio.h> void main() { clrscr(); int *a,*b,*temp; cout<<“Enter value of a and b:”; cin>>*a>>*b; temp=a; a=b; b=temp; cout<<“nAfter swapingna=”<<*a<<“nb=”<<*b; getch(); }

C++ program to swap two numbers using pointers Read More »

C++ program to find sum of series 1+1/2^2+1/3^3+…..+1/n^n

Sum of Series

#include<iostream.h> #include<conio.h> #include<math.h> void main() { clrscr(); double sum=0,a; int n,i; cout<<“1+1/2^2+1/3^3+…..+1/n^n”; cout<<“nEnter value of n:”; cin>>n; for(i=1;i<=n;++i) { a=1/pow(i,i); sum+=a; } cout<<“Sum=”<<sum; getch(); }

C++ program to find sum of series 1+1/2^2+1/3^3+…..+1/n^n Read More »

C program to print following triangle:

Print Figures

#include<stdio.h> #include<conio.h> void main() { int i,j,k,n,a,b; clrscr(); printf(“How many lines?”); scanf(“%d”,&n); n=n*2; for(i=1;i<n;i+=2) { for(j=n-1;j>i;j-=2) printf(” “); for(k=1;k<=(i/2)+1;++k) printf(“%d”,k); for(k=i/2;k>=1;–k) printf(“%d”,k); printf(“n”); } getch(); }

C program to print following triangle: Read More »

C program to check whether given string is palindrome or not

String

#include<stdio.h> #include<conio.h> #include<string.h> void main() { int i,j,flag=1,len; char str[50]; clrscr(); printf(“Enter any string:”); gets(str); len=strlen(str); for(i=0,j=len-1;i<len/2;++i,–j) if(str[i]!=str[j]) { flag=0; break; } if(flag) printf(“String is palindrome“); else printf(“String is not palindrome”); getch(); }

C program to check whether given string is palindrome or not Read More »

← Previous 1 … 165 166 167 … 187 Next →

Important Pages

  • About
  • Contact
  • Write for Us
  • Privacy Policy  

Categories

  • Home
  • C
    • Programs
    • Tutorials
    • Interview Questions
  • C++
    • Programs
    • Tutorials
    • Interview Questions
  • Java
    • Programs
    • Tutorials
    • Interview Questions
  • Android
  • Python
    • Tutorials
    • Programs
    • Interview Questions
    • Django Tutorials
  • .Net
    • C#
    • VB.Net
      • Tutorials
      • Interview Questions
    • ASP.NET
  • PHP
  • Batch File
  • JavaScript
  • SQL
  • PL/SQL
    • Tutorials
    • Programs
    • Interview Questions
  • Programming
    • Articles
    • Tutorials
    • Projects
  • Interview Q & A
  • Books
  • DSA
  • Design
    • Design
    • HTML Interview Questions
  • Development
  • Review
  • Sponsored
  • Tools

Copyright © 2026 The Crazy Programmer