What’s Knowledge abstraction? Knowledge abstraction permits a program to disregard the small print of how an information sort is represented. […]
Category: C++ Tutorial
C++ Encapsulation
C++ Encapsulation As you all know that C++ is wealthy in Objects and Lessons. So, it comes below Object Oriented […]
Polymorphism in C++
The time period Polymorphism get derived from the Greek phrase the place ‘poly’ + ‘morphos’ the place ‘poly’ means many […]
Inheritance in C++ with Example
C++ Inheritance Reusability is yet one more necessary characteristic of Object Oriented Programming (OOP). It’s a good observe if programmers […]
C++ Friend Virtual Function
C++ Good friend Perform In C++ a perform or a complete class could also be declared to be a buddy […]
C++ Files and Streams
In C++ programming we’re utilizing the iostream normal library, it supplies cin and cout strategies for studying from enter and […]
C++ Basic Example for student and Programmer
C++ Applications 1. Test No. is Prime or Not Prime.
1 |
<span class="com">#embody</span><span class="str"><iostream.h></iostream.h></span><span class="com">#embody</span><span class="str"><conio.h></conio.h></span><span class="kwd">void</span><span class="pln"> foremost</span><span class="pun">()</span><span class="pun">{</span> <span class="kwd">int</span><span class="pln"> i</span><span class="pun">,</span><span class="kwd">no</span><span class="pun">;</span><span class="pln"> clrscr</span><span class="pun">();</span><span class="pln"> cout</span><span class="pun"><<</span><span class="str">"Enter any num: "</span><span class="pun">;</span><span class="pln"> cin</span><span class="pun">>></span><span class="kwd">no</span><span class="pun">;</span> <span class="kwd">if</span><span class="pun">(</span><span class="kwd">no</span><span class="pun">==</span><span class="lit">1</span><span class="pun">)</span> <span class="pun">{</span><span class="pln"> cout</span><span class="pun"><<</span><span class="str">"Smallest prime num is 2"</span><span class="pun">;</span> <span class="pun">}</span> <span class="kwd">for</span><span class="pun">(</span><span class="pln">i</span><span class="pun">=</span><span class="lit">2</span><span class="pun">;</span><span class="pln">i</span><span class="pun"><</span><span class="kwd">no</span><span class="pun">;</span><span class="pln">i</span><span class="pun">++)</span> <span class="pun">{</span> <span class="kwd">if</span><span class="pun">(</span><span class="kwd">no</span><span class="pun">%</span><span class="pln">i</span><span class="pun">==</span><span class="lit">0</span><span class="pun">)</span> <span class="pun">{</span><span class="pln"> cout</span><span class="pun"><<</span><span class="str">"Not prime num"</span><span class="pun">;</span> <span class="kwd">break</span><span class="pun">;</span> <span class="pun">}</span> <span class="pun">}</span> <span class="kwd">if</span><span class="pun">(</span><span class="kwd">no</span><span class="pun">==</span><span class="pln">i</span><span class="pun">)</span> <span class="pun">{</span><span class="pln"> cout</span><span class="pun"><<</span><span class="str">"Prime num"</span><span class="pun">;</span> <span class="pun">}</span><span class="pln"> getch</span><span class="pun">();</span><span class="pun">}</span> |
1 |
Enter any num: 10Not Prime Num |
2. Print subsequent Prime quantity. Once we enter […]
C++ Object Oriented Programming
This tutorial sequence will enable you to to get began in C++ Programming Language from its fundamentals. C++ is […]
C++ interview Question
C++ interview Query 1. What’s the full type of OOPS? Object Oriented Programming System. 2. What’s a category? Class is […]
Introduction Of C++
This tutorial sequence will allow you to to get began in C++ Programming Language from its fundamentals. C++ is a […]
Introduction to C++
Introduction to C++ C++, as everyone knows is an extension to C language and was developed by Bjarne stroustrup at […]
History of C++ language
Historical past of C++ Historical past of C++ language is fascinating to know. Right here we’re going to focus on […]
C++ Program Structure
C++ Program Construction This tutorial describes about program construction of C++ program. Principally a C++ program entails the next part: […]
Data Types in C++
Knowledge Varieties in C++ They’re used to outline kind of variables and contents used. Knowledge varieties outline the best way […]
Basic Input/Output in C++
Fundamental Enter/Output in C++ In each program, there may be some information which is taken as enter and generate the […]
Variables in C++
Variables in C++ Variable are utilized in C++, the place we’d like storage for any worth, which is able […]
Operators in C++ with Example
Operators in C++ Operators are particular sort of features, that takes a number of arguments and produces a brand new […]
Operator Overloading in C++ With Example
Operator Overloading Operator Overloading Operator overloading is a crucial idea in C++. It’s a sort of polymorphism during which an […]
C++ Function with Example
C++ Operate Capabilities are used to supply modularity to a program. Creating an utility utilizing perform makes […]
C++ Function Overloading with example
C++ Perform Overloading Perform Overloading If any class have a number of features with identical names however […]