Command Line Arguments in C++

This C++ program illustrates the use of command line arguments. The parameter argc passed to the main of the C++ program contains the number of arguments passed to the main function and the argv parameter contains the pointers to the character strings passed as the command-line arguments. Based on the value of these arguments, the … Read more

advertisement

C++ Program to Check Whether a Character is a Vowel, Consonant or Digit

This is a C++ Program to Check if a Character is a Vowel, Consonant or Digit. Problem Description The program takes a character and checks if it is a vowel, consonant or a digit. Problem Solution 1. A character is entered. 2. Using nested if else condition, the character is checked if it is a … Read more

advertisement

C++ Program to Print ASCII Value of All Characters in the String

This is a C++ Program to Display the ASCII Value of the Character Entered. Problem Description The program takes a character and prints its ASCII value. ASCII stands for American Standard Code for Information Interchange which is a numerical representation of characters in computers ranging from 0 to 127. Problem Solution 1. A character is … Read more

advertisement

C++ Program to Check Whether a Given Year is a Leap Year

This C++ Program which checks if the year entered is a leap year. The program checks whether the entered year is divisible by 4 since leap year repeats itself every four year and if the year is divisible by 4, the year is a leap year. Here is source code of the C++ program which … Read more

advertisement

C++ Program to Display Current Date and Time

This C++ program prints the current date and time. The program uses the time library where a time_t structure is initialized to current date and time. The various members of the structure, i.e. current date, day in week, month and year, etc. can be accessed and the date can be printed in any format. The … Read more

advertisement

Sum of Digits Program in C++

This C++ Program which gets a number from input and displays the sum of the digits in the given number. The program uses a while loop to go through each and every digit of the given number and adds them up in the loop. Here is source code of the C++ program which gets a … Read more

advertisement

C++ Program to Reverse a Number without using Recursion

This is a C++ Program to Reverse a Given Number Without Using Recursion. Problem Description The program takes a given number and prints its reverse. Problem Solution 1. The program takes an integer number. 2. Using a while loop, the digits of the number are reversed. 3. The reverse number is printed. 4. Exit. C++ … Read more

advertisement

C program to Check Whether a Number is Positive or Negative

This is a C++ Program to Check if a Number is Positive or Negative. Problem Description The program takes a number and checks if it is a positive number or negative number. Problem Solution 1. The program takes a number. 2. It is checked if it is positive or negative. 3. The result is printed. … Read more

advertisement

C++ Program to Check Whether a Number is Even

This is a C++ Program to Check if a Number is Even. Problem Description The program checks if an entered number is even or not. Problem Solution 1. The program takes a number and stores it. 2. If the entered number is divisible by 2, then it is even. 3. Else the number is not … Read more

advertisement

C++ Program to Check Whether a Given Number is Even or Odd

This C+ +Program checks if a given integer is odd or even. Here if a given number is divisible by 2 with the remainder 0 then the number is even number. If the number is not divisible by 2 then that number will be odd number. Here is source code of the C++ program which … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & technical discussions at Telegram SanfoundryClasses.