<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technotip.com</title>
	<atom:link href="http://technotip.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://technotip.com</link>
	<description>Code is poetry!</description>
	<lastBuildDate>Wed, 22 Feb 2012 09:28:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Biggest of 2 Numbers Using Function: C++</title>
		<link>http://technotip.com/1375/biggest-of-2-numbers-using-function-cpp/</link>
		<comments>http://technotip.com/1375/biggest-of-2-numbers-using-function-cpp/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 08:57:33 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[biggest]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[definition]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[ternary operator]]></category>

		<guid isPermaLink="false">http://technotip.com/?p=1375</guid>
		<description><![CDATA[Find the biggest of two numbers using function and ternary operator. Basics of functions: A function is a sub program to perform a specific task. OR a group of instructions to perform specific task. Along with main() it is possible to define our own functions by following these steps: 1. Function prototype or Function declaration. [...]
Related posts:<ol>
<li><a href='http://technotip.com/1217/biggest-of-two-numbers-using-ternary-operator-cpp/' rel='bookmark' title='Biggest of Two Numbers Using Ternary Operator: C++'>Biggest of Two Numbers Using Ternary Operator: C++</a></li>
<li><a href='http://technotip.com/1239/biggest-of-3-numbers-using-ternary-operator-cpp/' rel='bookmark' title='Biggest of 3 Numbers Using Ternary Operator: C++'>Biggest of 3 Numbers Using Ternary Operator: C++</a></li>
<li><a href='http://technotip.com/1238/biggest-of-3-numbers-cpp/' rel='bookmark' title='Find Biggest of 3 Numbers: C++'>Find Biggest of 3 Numbers: C++</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Find the biggest of two numbers using function and ternary operator.</p>
<p><b>Basics of functions:</b></p>
<p>A function is a sub program to perform a specific task.<br />
OR<br />
a group of instructions to perform specific task.</p>
<p>Along with main() it is possible to define our own functions by following these steps:<br />
<strong>1.</strong> Function prototype or Function declaration.<br />
<strong>2.</strong> Function call.<br />
<strong>3.</strong> Function definition.</p>
<p><strong>Function Prototype:</strong></p>
<p>Giving information about the function such as return type, function name and arguments type to the compiler is known as function prototype; It is written at the declaration section.<br />
<strong>Syntax:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt; return_type &gt; &lt; function_name &gt;( arguments_type );</pre></div></div>

<p><strong>Example:</strong><br />
int findsum(int a, int b);<br />
float findsum(int a, int b);<br />
void findsum(int a, int b);<br />
int findsum(int a[], int size);<br />
int findsum(int, int);</p>
<p><strong>Function Definition:</strong><br />
Writing the actual code of the function in a block. It is at this stage the task of the function is defined. It is written after the main function.<br />
<strong>Syntax:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt; return_type &gt;&lt; function_name &gt;(parameters)
{
&nbsp;
}</pre></div></div>

<p><strong>Example:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">int findsum(int a, int b)
{
 int sum;
&nbsp;
 sum = a + b;
 return(sum);
}</pre></div></div>

<p><strong>Function Call:</strong><br />
It is a technique used to invoke a function.<br />
<strong>Syntax:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">[variable] &lt; function_name &gt;([arguments]);</pre></div></div>

<p><strong>Example:</strong><br />
res = findsum(10, 20);<br />
res = findsum(x, y);<br />
res = findsum();</p>
<p><strong>Full Source Code:</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">#include&lt; iostream.h &gt;
#include&lt; conio.h &gt;
&nbsp;
void main()
{
  int Big(int x,int y);  // Prototype
&nbsp;
  int a, b;
  clrscr();
&nbsp;
  cout&lt; &lt;&quot;Enter 2 numbers\n&quot;;
  cin&gt;&gt;a&gt;&gt;b;
&nbsp;
  int res = Big(a, b);   // Function call
&nbsp;
  cout&lt; &lt;&quot;Biggest = &quot;&lt;&lt;res;
  getch();
}
&nbsp;
int Big(int x, int y)   // Function Definition
{
  return( x&gt;y?x:y );
}</pre></td></tr></table></div>

<p><b>You must also watch these videos, before continuing with this program:</b><br />
<a href="http://technotip.com/1206/find-biggest-of-2-numbers-cpp/" title="Find Biggest of 2 Numbers: C++">Find Biggest of 2 Numbers: C++</a><br />
<a href="http://technotip.com/1217/biggest-of-two-numbers-using-ternary-operator-cpp/" title="Biggest of Two Numbers Using Ternary Operator: C++">Biggest of Two Numbers Using Ternary Operator: C++</a></p>
<p><b>Video Tutorial: Biggest of 2 Numbers Using Function</b><br />
<center><br />
<a href="http://technotip.com/1375/biggest-of-2-numbers-using-function-cpp/"><img src="http://img.youtube.com/vi/mZOaAXL4t9c/default.jpg" width="130" height="97" border title="Biggest of 2 Numbers Using Function: C++" alt="default Biggest of 2 Numbers Using Function: C++" /></a><br />
</center></p>
<div style="font-size: small;">YouTube Link: <a href="http://www.youtube.com/watch?v=mZOaAXL4t9c&#038;fmt=22">http://www.youtube.com/watch?v=mZOaAXL4t9c</a> [Watch the Video In Full Screen.]</div>
<p><br style="clear: both;" /><br />
</p>
<p><b>Output:</b><br />
Enter 2 numbers<br />
420<br />
305<br />
Biggest = 420</p>
<p>Related posts:<ol>
<li><a href='http://technotip.com/1217/biggest-of-two-numbers-using-ternary-operator-cpp/' rel='bookmark' title='Biggest of Two Numbers Using Ternary Operator: C++'>Biggest of Two Numbers Using Ternary Operator: C++</a></li>
<li><a href='http://technotip.com/1239/biggest-of-3-numbers-using-ternary-operator-cpp/' rel='bookmark' title='Biggest of 3 Numbers Using Ternary Operator: C++'>Biggest of 3 Numbers Using Ternary Operator: C++</a></li>
<li><a href='http://technotip.com/1238/biggest-of-3-numbers-cpp/' rel='bookmark' title='Find Biggest of 3 Numbers: C++'>Find Biggest of 3 Numbers: C++</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://technotip.com/1375/biggest-of-2-numbers-using-function-cpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Basic) Find Sum Using Dynamic Memory Allocation: C++</title>
		<link>http://technotip.com/1363/basic-find-sum-using-dynamic-memory-allocation-cpp/</link>
		<comments>http://technotip.com/1363/basic-find-sum-using-dynamic-memory-allocation-cpp/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 09:17:08 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[deallocation]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[dynamic memory allocation]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[operators]]></category>
		<category><![CDATA[sum]]></category>

		<guid isPermaLink="false">http://technotip.com/?p=1363</guid>
		<description><![CDATA[This video tutorial illustrates basics of Dynamic memory allocation in C++. It shows the use of new and delete operator for allocating and deallocating the memory dynamically. Find the sum of entered elements using dynamic memory allocation in c++. In cpp, dynamic memory management can be done using the operators new and delete. Operator new [...]
Related posts:<ol>
<li><a href='http://technotip.com/1277/array-basic-in-cpp-find-sum/' rel='bookmark' title='Array Basics in C++ : Find Sum'>Array Basics in C++ : Find Sum</a></li>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1341/reverse-given-number-check-palindrome-cpp/' rel='bookmark' title='Reverse Given Number And Check For Palindrome: C++'>Reverse Given Number And Check For Palindrome: C++</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This video tutorial illustrates basics of Dynamic memory allocation in C++. It shows the use of <strong>new</strong> and <strong>delete</strong> operator for <strong>allocating</strong> and <strong>deallocating</strong> the memory dynamically.</p>
<p>Find the sum of entered elements using dynamic memory allocation in c++.</p>
<p>In cpp, dynamic memory management can be done using the operators <strong>new</strong> and <strong>delete</strong>.<br />
Operator <strong>new</strong> is used to allocate the memory during execution time or run time, the dynamically allocated memory can be freed / released using the operator <strong>delete</strong>.<br />
<b>Syntax:</b></p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">&lt; data_type &gt;  &lt; pointer_variable &gt; = new &lt; data_type &gt;[size];</pre></div></div>

<p><b>Full Source code</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">#include&lt; iostream .h&gt;
#include&lt; conio .h&gt;
&nbsp;
void main()
{
  int sum=0, N;
  clrscr();
&nbsp;
  cout&lt; &lt;&quot;Enter array size\n&quot;;
  cin&gt;&gt;N;
&nbsp;
  int *a = new int[N];
  cout&lt; &lt;&quot;\nEnter &quot;&lt;&lt;N&lt;&lt;&quot; integer numbers&quot;&lt;&lt;endl;
  for(int i=0; i&lt;N; i++)
   cin&gt;&gt;a[i];
&nbsp;
   cout&lt; &lt;&quot;Input array is..&quot;&lt;&lt;endl;
   for(i=0; i&lt;N; i++)
   {
    cout&lt;&lt;a[i]&lt;&lt;endl;
    sum = sum + a[i]; // sum += a[i];
   }
   cout&lt;&lt;&quot;Total Sum: &quot;&lt;&lt;sum;
&nbsp;
   delete(a);
   getch();
}</pre></td></tr></table></div>

<p>We need not include any extra header file to perform dynamic memory allocation or de-allocation.</p>
<p><strong>int *ptr = new int[N];</strong></p>
<p>here it is mandatory to take pointer variable for dynamic memory allocation.</p>
<p>for de-allocation we use delete operator: <strong>delete(ptr);</strong></p>
<p><b>NOTE:</b><br />
<strong>Student *p = new Student[3];</strong></p>
<p>where Student is a user defined data type, maybe structure or class.</p>
<p><strong>Student *p = new Student;</strong> // This is for only 1 student.</p>
<p><b>Video Tutorial:(Basic) Find Sum Using Dynamic Memory Allocation</b><br />
<center><br />
<a href="http://technotip.com/1363/basic-find-sum-using-dynamic-memory-allocation-cpp/"><img src="http://img.youtube.com/vi/Iqqfa-UjONo/default.jpg" width="130" height="97" border title="(Basic) Find Sum Using Dynamic Memory Allocation: C++" alt="default (Basic) Find Sum Using Dynamic Memory Allocation: C++" /></a><br />
</center></p>
<div style="font-size: small;">YouTube Link: <a href="http://www.youtube.com/watch?v=Iqqfa-UjONo&#038;fmt=22">http://www.youtube.com/watch?v=Iqqfa-UjONo</a> [Watch the Video In Full Screen.]</div>
<p><br style="clear: both;" /><br />
</p>
<p><b>Output:</b><br />
Enter array size<br />
5<br />
Enter 5 integer numbers<br />
1<br />
2<br />
3<br />
4<br />
5<br />
Input array is..<br />
1<br />
2<br />
3<br />
4<br />
5<br />
Total Sum: 15</pre>
<p>Related posts:<ol>
<li><a href='http://technotip.com/1277/array-basic-in-cpp-find-sum/' rel='bookmark' title='Array Basics in C++ : Find Sum'>Array Basics in C++ : Find Sum</a></li>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1341/reverse-given-number-check-palindrome-cpp/' rel='bookmark' title='Reverse Given Number And Check For Palindrome: C++'>Reverse Given Number And Check For Palindrome: C++</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://technotip.com/1363/basic-find-sum-using-dynamic-memory-allocation-cpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reverse Given Number And Check For Palindrome: C++</title>
		<link>http://technotip.com/1341/reverse-given-number-check-palindrome-cpp/</link>
		<comments>http://technotip.com/1341/reverse-given-number-check-palindrome-cpp/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 14:53:17 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[palindrome]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[reverse]]></category>

		<guid isPermaLink="false">http://technotip.com/?p=1341</guid>
		<description><![CDATA[Cpp program to read a number, reverse the given number and check whether it is palindrome or not. Full Source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 #include&#60; iostream .h&#62; #include&#60; conio [...]
Related posts:<ol>
<li><a href='http://technotip.com/1266/find-the-factorial-of-a-number-cpp/' rel='bookmark' title='Find the Factorial of a Number: C++'>Find the Factorial of a Number: C++</a></li>
<li><a href='http://technotip.com/1277/array-basic-in-cpp-find-sum/' rel='bookmark' title='Array Basics in C++ : Find Sum'>Array Basics in C++ : Find Sum</a></li>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Cpp program to read a number, reverse the given number and check whether it is palindrome or not.</p>
<p><b>Full Source code</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">#include&lt; iostream .h&gt;
#include&lt; conio .h&gt;
&nbsp;
void main()
{
  int num, rem, sum = 0, temp;
  clrscr();
&nbsp;
  cout&lt; &lt;&quot;Enter a number\n&quot;;
  cin&gt;&gt;num;
&nbsp;
  temp = num;
&nbsp;
  while( num )
  {
    rem = num % 10;
    num = num / 10;
    sum = sum * 10 + rem;
  }
&nbsp;
cout&lt; &lt;&quot;\nReversed Number: &quot;&lt;&lt;sum&lt;&lt;endl;
&nbsp;
  if( temp == sum )
   cout&lt;&lt;temp&lt;&lt;&quot; is a palindrome&quot;;
  else
   cout&lt;&lt;temp&lt;&lt;&quot; in NOT a palindrome&quot;;
&nbsp;
  getch();
}</pre></td></tr></table></div>

<p>In this program we assign variable sum = 0 to avoid garbage values in sum before the calculation, which would result in wrong output.<br />
We store the user entered value in temp, so that we can compare it with the final result, to determine whether the given number is palindrome or not.
</pre>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="language" style="font-family:monospace;"> while( num )
  {
    rem = num % 10;
    num = num / 10;
    sum = sum * 10 + rem;
  }</pre></td></tr></table></div>

<p>Here the loop executes until the value of num is zero.</p>
<p>If user enters 301, we apply the modulus to get the individual values.<br />
Ex:<br />
301 % 10 = 1<br />
30  % 10 = 0<br />
3   % 10 = 3</p>
<p>We get 301, 30 and 3 by dividing the original value by 10.<br />
Ex:<br />
301 user entered value.<br />
301 / 10 = 30<br />
30  / 10 = 3</p>
<p>Now the sum. </p>
<p>sum = sum * 10 + rem;</p>
<p>1   = 0 * 10 + 1<br />
10   = 1 * 10 + 0<br />
103  = 10 * 10 + 3</p>
<p>So the reverse of 301 is 103, which is not a palindrome.</p>
<p><b>Video Tutorial: Reverse Given Number And Check For Palindrome: C++</b><br />
<center><br />
<a href="http://technotip.com/1341/reverse-given-number-check-palindrome-cpp/"><img src="http://img.youtube.com/vi/j8Vv4wgdwoA/default.jpg" width="130" height="97" border title="Reverse Given Number And Check For Palindrome: C++" alt="default Reverse Given Number And Check For Palindrome: C++" /></a><br />
</center></p>
<div style="font-size: small;">YouTube Link: <a href="http://www.youtube.com/watch?v=j8Vv4wgdwoA&#038;fmt=22">http://www.youtube.com/watch?v=j8Vv4wgdwoA</a> [Watch the Video In Full Screen.]</div>
<p><br style="clear: both;" /><br />
</p>
<p><b>Output:</b><br />
Enter a number<br />
301<br />
Reversed Number: 103<br />
301 in NOT a palindrome</p>
<p>Related posts:<ol>
<li><a href='http://technotip.com/1266/find-the-factorial-of-a-number-cpp/' rel='bookmark' title='Find the Factorial of a Number: C++'>Find the Factorial of a Number: C++</a></li>
<li><a href='http://technotip.com/1277/array-basic-in-cpp-find-sum/' rel='bookmark' title='Array Basics in C++ : Find Sum'>Array Basics in C++ : Find Sum</a></li>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://technotip.com/1341/reverse-given-number-check-palindrome-cpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Array Basics in C++ : Find Sum</title>
		<link>http://technotip.com/1277/array-basic-in-cpp-find-sum/</link>
		<comments>http://technotip.com/1277/array-basic-in-cpp-find-sum/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 13:15:25 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[declaration]]></category>
		<category><![CDATA[initialization]]></category>
		<category><![CDATA[sum]]></category>

		<guid isPermaLink="false">http://technotip.com/?p=1277</guid>
		<description><![CDATA[Video tutorial to show the basic use of arrays: Initialization, Declaration, Getting values from the users, finding sum of all the array elements etc. Array is a collection of homogeneous data items. Full Source Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [...]
Related posts:<ol>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1238/biggest-of-3-numbers-cpp/' rel='bookmark' title='Find Biggest of 3 Numbers: C++'>Find Biggest of 3 Numbers: C++</a></li>
<li><a href='http://technotip.com/1266/find-the-factorial-of-a-number-cpp/' rel='bookmark' title='Find the Factorial of a Number: C++'>Find the Factorial of a Number: C++</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Video tutorial to show the basic use of arrays: Initialization, Declaration, Getting values from the users, finding sum of all the array elements etc.</p>
<p>Array is a collection of homogeneous data items.</p>
<p><b>Full Source Code</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">#include&lt;iostream .h&gt;
#include&lt;conio .h&gt;
&nbsp;
void main()
{
  //  int a[5] = { 1, 3, 2, 4, 5 }; declaration with initialization
&nbsp;
  int a[5], sum = 0;
  clrscr();
&nbsp;
  cout&lt; &lt;&quot;Enter 5 numbers\n&quot;;
  for(int i=0; i&amp;lt;5; i++)
   cin&gt;&gt;a[i];
&nbsp;
  cout&lt; &lt;&quot;Input array is..\n&quot;;
  for(i=0; i&amp;lt;5; i++)
  {
   cout&lt;&lt;a[i]&lt;&lt;endl;
   sum = sum + a[i];  // sum += a[i];
  }
  cout&lt;&lt;&quot;Sum of array elements: &quot;&lt;&lt;sum;
&nbsp;
  getch();
&nbsp;
}</pre></td></tr></table></div>

<p>In this program we take input from the user and display the user entered numbers and find the sum of all the array elements and display it as well.</p>
<p>Elements are stored from the index number 0. i.e., if the array size is 5, the values will be stored in a[0], a[1], a[2], a[3], a[4];</p>
<p>Ex:<br />
 int a[5] = { 1, 3, 2, 4, 5 }; declaration with initialization<br />
 float a[5] = { 1.1, 2.0, 3.3, 1.3, 5.6 };</p>
<p><b>Video Tutorial: Array Basics in C++ : Find Sum </b><br />
<center><br />
<a href="http://technotip.com/1277/array-basic-in-cpp-find-sum/"><img src="http://img.youtube.com/vi/BfAa2koJv64/default.jpg" width="130" height="97" border title="Array Basics in C++ : Find Sum" alt="default Array Basics in C++ : Find Sum" /></a><br />
</center></p>
<div style="font-size: small;">YouTube Link: <a href="http://www.youtube.com/watch?v=BfAa2koJv64&#038;fmt=22">http://www.youtube.com/watch?v=BfAa2koJv64</a> [Watch the Video In Full Screen.]</div>
<p><br style="clear: both;" /><br />
</p>
<p><b>Output:</b><br />
Enter 5 numbers<br />
1<br />
2<br />
3<br />
4<br />
5<br />
Input array is..<br />
1<br />
2<br />
3<br />
4<br />
5<br />
Sum of array elements: 15</conio></iostream></pre>
<p>Related posts:<ol>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1238/biggest-of-3-numbers-cpp/' rel='bookmark' title='Find Biggest of 3 Numbers: C++'>Find Biggest of 3 Numbers: C++</a></li>
<li><a href='http://technotip.com/1266/find-the-factorial-of-a-number-cpp/' rel='bookmark' title='Find the Factorial of a Number: C++'>Find the Factorial of a Number: C++</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://technotip.com/1277/array-basic-in-cpp-find-sum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find the Factorial of a Number: C++</title>
		<link>http://technotip.com/1266/find-the-factorial-of-a-number-cpp/</link>
		<comments>http://technotip.com/1266/find-the-factorial-of-a-number-cpp/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 06:10:39 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[fact]]></category>
		<category><![CDATA[factorial]]></category>

		<guid isPermaLink="false">http://technotip.com/?p=1266</guid>
		<description><![CDATA[Video tutorial to find the factorial of a number: if the user enters 3, then the factorial is 1 * 2 * 3 i.e., factorial = 6 This logic must be handled with a c++ program. Full Source Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 [...]
Related posts:<ol>
<li><a href='http://technotip.com/1238/biggest-of-3-numbers-cpp/' rel='bookmark' title='Find Biggest of 3 Numbers: C++'>Find Biggest of 3 Numbers: C++</a></li>
<li><a href='http://technotip.com/1206/find-biggest-of-2-numbers-cpp/' rel='bookmark' title='Find Biggest of 2 Numbers: C++'>Find Biggest of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Video tutorial to find the factorial of a number: if the user enters 3, then the factorial is 1 * 2 * 3 i.e., factorial = 6<br />
This logic must be handled with a c++ program.</p>
<p><b>Full Source Code</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">#include&lt;iostream .h&gt;
#include&lt;conio .h&gt;
&nbsp;
void main()
{
  int fact = 1, N;
  clrscr();
&nbsp;
  cout&lt; &lt;endl&lt;&lt;&quot;Enter a number\n&quot;;
  cin&gt;&gt;N;
&nbsp;
  for( int i=1; i&lt; =N; i++ )
   fact = fact * i;  // OR fact *= i;
&nbsp;
  cout&lt;&lt;endl&lt;&lt;endl&lt;&lt;&quot;Factorial of &quot;&lt;&lt;N&lt;&lt;&quot; is &quot;&lt;&lt;fact;
&nbsp;
  getch();
}</pre></td></tr></table></div>

<p>Here the for loop stars from 1 and not 0. As anything multiplied by 0 would also be zero.</p>
<p><center><img width="483" height="534" src="http://technotip.com/wp-content/uploads/cpp/factorial-cpp.png" alt="factorial cpp Find the Factorial of a Number: C++"  title="Find the Factorial of a Number: C++" /></center></p>
<p><br style="clear: both;" /></p>
<p>
fact *= i; is the compact representation of fact = fact * i;
</p>
<p><b>Video Tutorial: Factorial in cpp</b><br />
<center><br />
<a href="http://technotip.com/1266/find-the-factorial-of-a-number-cpp/"><img src="http://img.youtube.com/vi/ovrdIQZ6Hu8/default.jpg" width="130" height="97" border title="Find the Factorial of a Number: C++" alt="default Find the Factorial of a Number: C++" /></a><br />
</center></p>
<div style="font-size: small;">YouTube Link: <a href="http://www.youtube.com/watch?v=ovrdIQZ6Hu8&#038;fmt=22">http://www.youtube.com/watch?v=ovrdIQZ6Hu8</a> [Watch the Video In Full Screen.]</div>
<p><br style="clear: both;" /><br />
</p>
<p><b>Output:</b><br />
Enter a number<br />
5<br />
Factorial of 5 is 120</conio></iostream></pre>
<p>Related posts:<ol>
<li><a href='http://technotip.com/1238/biggest-of-3-numbers-cpp/' rel='bookmark' title='Find Biggest of 3 Numbers: C++'>Find Biggest of 3 Numbers: C++</a></li>
<li><a href='http://technotip.com/1206/find-biggest-of-2-numbers-cpp/' rel='bookmark' title='Find Biggest of 2 Numbers: C++'>Find Biggest of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://technotip.com/1266/find-the-factorial-of-a-number-cpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Biggest of 3 Numbers Using Ternary Operator: C++</title>
		<link>http://technotip.com/1239/biggest-of-3-numbers-using-ternary-operator-cpp/</link>
		<comments>http://technotip.com/1239/biggest-of-3-numbers-using-ternary-operator-cpp/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 06:31:24 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[else if]]></category>
		<category><![CDATA[if else]]></category>
		<category><![CDATA[ternary operator]]></category>

		<guid isPermaLink="false">http://technotip.com/?p=1239</guid>
		<description><![CDATA[Video tutorial to find the biggest of the three integer numbers in C++, using if-else control statements and Ternary Operator. Before watching this video, please make sure to watch and understand this short video: Find Biggest of 3 Numbers: C++ Full Source Code 1 2 3 4 5 6 7 8 9 10 11 12 [...]
Related posts:<ol>
<li><a href='http://technotip.com/1217/biggest-of-two-numbers-using-ternary-operator-cpp/' rel='bookmark' title='Biggest of Two Numbers Using Ternary Operator: C++'>Biggest of Two Numbers Using Ternary Operator: C++</a></li>
<li><a href='http://technotip.com/1238/biggest-of-3-numbers-cpp/' rel='bookmark' title='Find Biggest of 3 Numbers: C++'>Find Biggest of 3 Numbers: C++</a></li>
<li><a href='http://technotip.com/1206/find-biggest-of-2-numbers-cpp/' rel='bookmark' title='Find Biggest of 2 Numbers: C++'>Find Biggest of 2 Numbers: C++</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Video tutorial to find the biggest of the three integer numbers in C++, using if-else control statements and Ternary Operator.</p>
<p>Before watching this video, please make sure to watch and understand this short video: <a href="http://technotip.com/1238/biggest-of-3-numbers-cpp/" title="Biggest of 3 Numbers">Find Biggest of 3 Numbers: C++</a></p>
<p><b>Full Source Code</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">#include&lt;iostream .h&gt;
#include&lt;conio .h&gt;
&nbsp;
void main()
{
	int a, b, c;
	clrscr();
&nbsp;
	cout&lt; &lt;&quot;Enter 3 no's\n&quot;;
	cin&gt;&gt;a&gt;&gt;b&gt;&gt;c;
&nbsp;
	int big =  ( a&gt;b &amp;&amp; a&gt;c )?a:(b&gt;c?b:c);
	/*
	if( a &gt; b &amp;&amp; a &gt; c )
	  big = a;
	else if( b &gt; c )
	  big = b;
	else
	  big = c;
	*/
	cout&lt; &lt;&quot;\nAmong &quot;&lt;&lt;a&lt;&lt;&quot; , &quot;&lt;&lt;b&lt;&lt;&quot; , &quot;&lt;&lt;c&lt;&lt;&quot; Biggest is &quot;&lt;&lt;big;
	getch();
}</pre></td></tr></table></div>

<p>In this program we take 3 integer values from the user and using ternary operator decide the biggest of 3 numbers.</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">	int big =  ( a&gt;b &amp;&amp; a&gt;c )?a:(b&gt;c?b:c);</pre></div></div>

<p>if <strong>( a > b &#038;&#038; a > c )</strong> is true, then value of <strong>a</strong> will be stored in variable <strong>big</strong>; else <strong>( b > c ? b : c )</strong> will be evaluated. Here, if value of <strong>b</strong> is greater than <strong>c</strong>, value of <strong>b</strong> will be stored in variable <strong>big</strong> else value of <strong>c</strong> will be stored in the variable <strong>big</strong>.</p>
<p><b>Video Tutorial: Biggest of 3 Integer Numbers</b><br />
<center><br />
<a href="http://technotip.com/1239/biggest-of-3-numbers-using-ternary-operator-cpp/"><img src="http://img.youtube.com/vi/gfmqT4PwfY0/default.jpg" width="130" height="97" border title="Biggest of 3 Numbers Using Ternary Operator: C++" alt="default Biggest of 3 Numbers Using Ternary Operator: C++" /></a><br />
</center></p>
<div style="font-size: small;">YouTube Link: <a href="http://www.youtube.com/watch?v=gfmqT4PwfY0&#038;fmt=22">http://www.youtube.com/watch?v=gfmqT4PwfY0</a> [Watch the Video In Full Screen.]</div>
<p><br style="clear: both;" /><br />
</p>
<p><b>Output</b><br />
Enter 3 no&#8217;s<br />
10<br />
20<br />
30<br />
Among 10, 20, 30 Biggest is 30</conio></iostream></pre>
<p>Related posts:<ol>
<li><a href='http://technotip.com/1217/biggest-of-two-numbers-using-ternary-operator-cpp/' rel='bookmark' title='Biggest of Two Numbers Using Ternary Operator: C++'>Biggest of Two Numbers Using Ternary Operator: C++</a></li>
<li><a href='http://technotip.com/1238/biggest-of-3-numbers-cpp/' rel='bookmark' title='Find Biggest of 3 Numbers: C++'>Find Biggest of 3 Numbers: C++</a></li>
<li><a href='http://technotip.com/1206/find-biggest-of-2-numbers-cpp/' rel='bookmark' title='Find Biggest of 2 Numbers: C++'>Find Biggest of 2 Numbers: C++</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://technotip.com/1239/biggest-of-3-numbers-using-ternary-operator-cpp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Find Biggest of 3 Numbers: C++</title>
		<link>http://technotip.com/1238/biggest-of-3-numbers-cpp/</link>
		<comments>http://technotip.com/1238/biggest-of-3-numbers-cpp/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 07:06:29 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[biggest of 3]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[if else]]></category>

		<guid isPermaLink="false">http://technotip.com/?p=1238</guid>
		<description><![CDATA[Video tutorial to find the biggest of the three integer numbers in C++, using if-else control statements. Full Source Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 #include&#60;iostream .h&#62; #include&#60;conio .h&#62; &#160; void main() { int a, [...]
Related posts:<ol>
<li><a href='http://technotip.com/1206/find-biggest-of-2-numbers-cpp/' rel='bookmark' title='Find Biggest of 2 Numbers: C++'>Find Biggest of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1217/biggest-of-two-numbers-using-ternary-operator-cpp/' rel='bookmark' title='Biggest of Two Numbers Using Ternary Operator: C++'>Biggest of Two Numbers Using Ternary Operator: C++</a></li>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Video tutorial to find the biggest of the three integer numbers in C++, using if-else control statements.</p>
<p><b>Full Source Code</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">#include&lt;iostream .h&gt;
#include&lt;conio .h&gt;
&nbsp;
void main()
{
	int a, b, c;
	clrscr();
&nbsp;
	cout&lt; &lt;&quot;Enter 3 no\n&quot;;
	cin&gt;&gt;a&gt;&gt;b&gt;&gt;c;
&nbsp;
	int big;
&nbsp;
	if( a &gt; b )
	 big = a;
	else
	{
	 if( b &gt; c )
	  big = b;
	 else
	  big = c;
	}
	cout&lt; &lt;&quot;\nBiggest is: &quot;&lt;&lt;big;
	getch();
}</pre></td></tr></table></div>

<p>In this program we get three integer variables from the user.<br />
If value of variable <strong>a</strong> is bigger, then we store it inside the variable <strong>big</strong>; else we compare <strong>b</strong> with <strong>c</strong>. Now will store the biggest number inside the variable <strong>big</strong>.<br />
<b>Video Tutorial: Biggest of 3 Integer Numbers</b><br />
<center><br />
<a href="http://technotip.com/1238/biggest-of-3-numbers-cpp/"><img src="http://img.youtube.com/vi/YRkCpS_GMFw/default.jpg" width="130" height="97" border title="Find Biggest of 3 Numbers: C++" alt="default Find Biggest of 3 Numbers: C++" /></a><br />
</center></p>
<div style="font-size: small;">YouTube Link: <a href="http://www.youtube.com/watch?v=YRkCpS_GMFw&#038;fmt=22">http://www.youtube.com/watch?v=YRkCpS_GMFw</a> [Watch the Video In Full Screen.]</div>
<p><br style="clear: both;" /><br />
</p>
<p><b>Output</b><br />
Enter 3 no&#8217;s<br />
404<br />
501<br />
301<br />
Biggest is: 501</conio></iostream></pre>
<p>Related posts:<ol>
<li><a href='http://technotip.com/1206/find-biggest-of-2-numbers-cpp/' rel='bookmark' title='Find Biggest of 2 Numbers: C++'>Find Biggest of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1217/biggest-of-two-numbers-using-ternary-operator-cpp/' rel='bookmark' title='Biggest of Two Numbers Using Ternary Operator: C++'>Biggest of Two Numbers Using Ternary Operator: C++</a></li>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://technotip.com/1238/biggest-of-3-numbers-cpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Biggest of Two Numbers Using Ternary Operator: C++</title>
		<link>http://technotip.com/1217/biggest-of-two-numbers-using-ternary-operator-cpp/</link>
		<comments>http://technotip.com/1217/biggest-of-two-numbers-using-ternary-operator-cpp/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 11:53:19 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[biggest]]></category>
		<category><![CDATA[control statements]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[else if]]></category>
		<category><![CDATA[if else]]></category>
		<category><![CDATA[ternary operator]]></category>

		<guid isPermaLink="false">http://technotip.com/?p=1217</guid>
		<description><![CDATA[Video tutorial to find the biggest of the two integer numbers in C++, using Ternary Operator. To find biggest of Two numbers using if-else control structure: Find Biggest of 2 Numbers: C++ Full Source Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [...]
Related posts:<ol>
<li><a href='http://technotip.com/1206/find-biggest-of-2-numbers-cpp/' rel='bookmark' title='Find Biggest of 2 Numbers: C++'>Find Biggest of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1053/object-oriented-programming-c/' rel='bookmark' title='Object Oriented Programming: C++'>Object Oriented Programming: C++</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Video tutorial to find the biggest of the two integer numbers in C++, using Ternary Operator.</p>
<p>To find biggest of Two numbers using if-else control structure: <a href="http://technotip.com/1206/find-biggest-of-2-numbers-cpp/" title="biggest of 2 numbers">Find Biggest of 2 Numbers: C++</a></p>
<p><b>Full Source Code</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">#include&lt;iostream .h&gt;
#include&lt;conio .h&gt;
&nbsp;
void main()
{
 int a, b;
 clrscr();
&nbsp;
 cout&lt; &lt;&quot;Enter 2 numbers\n&quot;;
 cin&gt;&gt;a&gt;&gt;b;
&nbsp;
 int big;
&nbsp;
 big = a &gt; b ? a : b;
&nbsp;
/*
 if( a &gt; b )
  big = a;
 else
  big = b;
*/
&nbsp;
 cout&lt; &lt;&quot;\nBig is: &quot;&lt;&lt;big;
&nbsp;
 getch();
}</pre></td></tr></table></div>

<p>In this program we take 2 integer values from the user and using ternary operator decide the biggest of 2 numbers.</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">	 big = a &gt; b ? a : b;</pre></div></div>

<p>if <strong>( a > b )</strong> is true, then value of <strong>a</strong> will be stored in variable <strong>big</strong>; else value of <strong>b</strong> will be stored in <strong>big</strong>.</p>
<p><strong>Video Tutorial: Biggest of 2 Integer Numbers Using Ternary Operator</strong><br />
<center><br />
<a href="http://technotip.com/1217/biggest-of-two-numbers-using-ternary-operator-cpp/"><img src="http://img.youtube.com/vi/ni2btFMBmlA/default.jpg" width="130" height="97" border title="Biggest of Two Numbers Using Ternary Operator: C++" alt="default Biggest of Two Numbers Using Ternary Operator: C++" /></a><br />
</center></p>
<div style="font-size: small;">YouTube Link: <a href="http://www.youtube.com/watch?v=ni2btFMBmlA&#038;fmt=22">http://www.youtube.com/watch?v=ni2btFMBmlA</a> [Watch the Video In Full Screen.]</div>
<p><br style="clear: both;" /><br />
<br />
<b>Output</b><br />
Enter 3 no&#8217;s<br />
404<br />
302<br />
Big is: 404</conio></iostream></pre>
<p>Related posts:<ol>
<li><a href='http://technotip.com/1206/find-biggest-of-2-numbers-cpp/' rel='bookmark' title='Find Biggest of 2 Numbers: C++'>Find Biggest of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1053/object-oriented-programming-c/' rel='bookmark' title='Object Oriented Programming: C++'>Object Oriented Programming: C++</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://technotip.com/1217/biggest-of-two-numbers-using-ternary-operator-cpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find Biggest of 2 Numbers: C++</title>
		<link>http://technotip.com/1206/find-biggest-of-2-numbers-cpp/</link>
		<comments>http://technotip.com/1206/find-biggest-of-2-numbers-cpp/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 13:25:13 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[cpp. biggest]]></category>
		<category><![CDATA[if else]]></category>

		<guid isPermaLink="false">http://technotip.com/?p=1206</guid>
		<description><![CDATA[Video tutorial to find the biggest of the two integer numbers in C++, using if-else control statements. Full Source Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #include&#60;iostream .h&#62; #include&#60;conio .h&#62; &#160; void main() { int a, b; clrscr(); &#160; [...]
Related posts:<ol>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1053/object-oriented-programming-c/' rel='bookmark' title='Object Oriented Programming: C++'>Object Oriented Programming: C++</a></li>
<li><a href='http://technotip.com/780/simple-interest-c-program/' rel='bookmark' title='Simple Interest: C Program'>Simple Interest: C Program</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Video tutorial to find the biggest of the two integer numbers in C++, using if-else control statements.</p>
<p><b>Full Source Code</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">#include&lt;iostream .h&gt;
#include&lt;conio .h&gt;
&nbsp;
void main()
{
	int a, b;
	clrscr();
&nbsp;
	cout&lt; &lt;&quot;Enter 2 numbers\n&quot;;
	cin&gt;&gt;a&gt;&gt;b;
&nbsp;
	int big;
&nbsp;
	if( a &gt; b )
	 big = a;
	else
	 big = b;
&nbsp;
	cout&lt; &lt;endl&lt;&lt;&quot;Among &quot;&lt;&lt;a&lt;&lt;&quot; and &quot;&lt;&lt;b&lt;&lt;&quot; biggest is &quot;&lt;&lt;big;
&nbsp;
	getch();
}</pre></td></tr></table></div>

<p>In this program we get two integer variables from the user.<br />
If value of variable <strong>a</strong> is bigger, then we store it inside the variable <strong>big</strong>; else we store the value of variable <strong>b</strong> inside variable <strong>big</strong>.<br />
Finally display the value of variable <strong>big</strong> which contains the biggest number amongst the two values entered by the user.</p>
<p><strong>Video Tutorial: Biggest of 2 Integer Numbers</strong><br />
<center><br />
<a href="http://technotip.com/1206/find-biggest-of-2-numbers-cpp/"><img src="http://img.youtube.com/vi/awbq2gsDg3E/default.jpg" width="130" height="97" border title="Find Biggest of 2 Numbers: C++" alt="default Find Biggest of 2 Numbers: C++" /></a><br />
</center></p>
<div style="font-size: small;">YouTube Link: <a href="http://www.youtube.com/watch?v=awbq2gsDg3E&#038;fmt=22">http://www.youtube.com/watch?v=awbq2gsDg3E</a> [Watch the Video In Full Screen.]</div>
<p><br style="clear: both;" /><br />
</p>
<p><b>Output</b><br />
Enter 2 numbers<br />
-100<br />
0<br />
Among -100 and 0 biggest is 0</conio></iostream></pre>
<p>Related posts:<ol>
<li><a href='http://technotip.com/1200/addition-of-2-numbers-cpp/' rel='bookmark' title='Addition of 2 Numbers: C++'>Addition of 2 Numbers: C++</a></li>
<li><a href='http://technotip.com/1053/object-oriented-programming-c/' rel='bookmark' title='Object Oriented Programming: C++'>Object Oriented Programming: C++</a></li>
<li><a href='http://technotip.com/780/simple-interest-c-program/' rel='bookmark' title='Simple Interest: C Program'>Simple Interest: C Program</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://technotip.com/1206/find-biggest-of-2-numbers-cpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Addition of 2 Numbers: C++</title>
		<link>http://technotip.com/1200/addition-of-2-numbers-cpp/</link>
		<comments>http://technotip.com/1200/addition-of-2-numbers-cpp/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 17:35:47 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[addition]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[integer]]></category>

		<guid isPermaLink="false">http://technotip.com/?p=1200</guid>
		<description><![CDATA[This video tutorial illustrates a simple program of adding two integer numbers. Full Source Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #include&#60;iostream .h&#62; #include&#60;conio .h&#62; &#160; void main() { &#160; int a, b; clrscr(); &#160; cout&#60; &#60;&#34;Enter two no\n&#34;; cin&#62;&#62;a&#62;&#62;b; &#160; int [...]
Related posts:<ol>
<li><a href='http://technotip.com/673/using-constructors-member-function-to-add-two-numbers-java/' rel='bookmark' title='Using Constructors &amp; Member Function to add two numbers: Java'>Using Constructors &#038; Member Function to add two numbers: Java</a></li>
<li><a href='http://technotip.com/1053/object-oriented-programming-c/' rel='bookmark' title='Object Oriented Programming: C++'>Object Oriented Programming: C++</a></li>
<li><a href='http://technotip.com/780/simple-interest-c-program/' rel='bookmark' title='Simple Interest: C Program'>Simple Interest: C Program</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This video tutorial illustrates a simple program of adding two integer numbers.</p>
<p><b>Full Source Code</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">#include&lt;iostream .h&gt;
#include&lt;conio .h&gt;
&nbsp;
void main()
{
&nbsp;
 int a, b;
 clrscr();
&nbsp;
 cout&lt; &lt;&quot;Enter two no\n&quot;;
 cin&gt;&gt;a&gt;&gt;b;
&nbsp;
 int sum = a + b;
&nbsp;
 cout&lt; &lt;endl&lt;&lt;&quot;Sum is: &quot;&lt;&lt;sum;
&nbsp;
 getch();
&nbsp;
}</pre></td></tr></table></div>

<p>We can declare variables anywhere in a cpp program.</p>
<p><strong>Video Tutorial: Addition of 2 Integer Numbers</strong><br />
<center><br />
<a href="http://technotip.com/1200/addition-of-2-numbers-cpp/"><img src="http://img.youtube.com/vi/GBbOJZLkBBA&#038;ap=%2526fmt%3D22/default.jpg" width="130" height="97" border title="Addition of 2 Numbers: C++" alt="default Addition of 2 Numbers: C++" /></a><br />
</center></p>
<div style="font-size: small;">YouTube Link: <a href="http://www.youtube.com/watch?v=GBbOJZLkBBA&#038;fmt=22">http://www.youtube.com/watch?v=GBbOJZLkBBA</a> [Watch the Video In Full Screen.]</div>
<p><br style="clear: both;" /><br />
</p>
<p>In this program we take input from the user, add it and then echo the result back to the screen.</p>
<p><b>Output</b><br />
Enter two no<br />
100<br />
200</p>
<p>Sum is: 300</conio></iostream></pre>
<p>Related posts:<ol>
<li><a href='http://technotip.com/673/using-constructors-member-function-to-add-two-numbers-java/' rel='bookmark' title='Using Constructors &amp; Member Function to add two numbers: Java'>Using Constructors &#038; Member Function to add two numbers: Java</a></li>
<li><a href='http://technotip.com/1053/object-oriented-programming-c/' rel='bookmark' title='Object Oriented Programming: C++'>Object Oriented Programming: C++</a></li>
<li><a href='http://technotip.com/780/simple-interest-c-program/' rel='bookmark' title='Simple Interest: C Program'>Simple Interest: C Program</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://technotip.com/1200/addition-of-2-numbers-cpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Object Oriented Programming: C++</title>
		<link>http://technotip.com/1053/object-oriented-programming-c/</link>
		<comments>http://technotip.com/1053/object-oriented-programming-c/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 12:37:01 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[oops]]></category>

		<guid isPermaLink="false">http://technotip.com/?p=1053</guid>
		<description><![CDATA[To understand and switch from C to C++, you need to know some of the basic similarities and differences between the two. Sample C Program: #include&#60;stdio.h&#62; void main() { printf("Welcome To C"); } Here stdio.h header file is included inorder to make use of printf and scanf functions. Sample Cpp Program: #include&#60;iostream.h&#62; void main() { [...]
Related posts:<ol>
<li><a href='http://technotip.com/662/first-java-program-basic/' rel='bookmark' title='First Java Program: Basic'>First Java Program: Basic</a></li>
<li><a href='http://technotip.com/262/event-object-javascript/' rel='bookmark' title='Event Object: Javascript'>Event Object: Javascript</a></li>
<li><a href='http://technotip.com/673/using-constructors-member-function-to-add-two-numbers-java/' rel='bookmark' title='Using Constructors &amp; Member Function to add two numbers: Java'>Using Constructors &#038; Member Function to add two numbers: Java</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>To understand and switch from C to C++, you need to know some of the basic similarities and differences between the two.</p>
<p><b>Sample C Program:</b></p>
<pre name="code" class="c">
#include&lt;stdio.h&gt;

void main()
{
  printf("Welcome To C");
}
</pre>
<p>Here stdio.h header file is included inorder to make use of printf and scanf functions.</p>
<p><b>Sample Cpp Program:</b></p>
<pre name="code" class="cpp">
#include&lt;iostream.h&gt;

void main()
{
  cout&lt;&lt;"Welcome To Cpp";
}
</pre>
<p>Here iostream.h header file is included inorder to make use of cout and cin objects.</p>
<p>cout is an object of class ostream.<br />
cin is an object of class istream.</p>
<p>Both these ostream and istream classes are present inside iostream.h file.</p>
<p>In both C and C++, execution of the program starts from main() function.</p>
<p>The difference is, printf and scanf are functions; while cout and cin are objects.</p>
<p><strong>&lt;&lt;</strong> is called Insertion Operator. To show result on output window.<br />
<strong>&gt;&gt;</strong> is called Extraction Operator. To get input from the user(keyboard).</p>
<p><b>Structures In C:</b></p>
<pre name="code" class="c">
struct Student
{
  String name[];
  int age;
}s1;
</pre>
<p>To access members of structure:</p>
<pre name="code" class="cpp">
s1.name[];
s1.age;
</pre>
<p><strong>Video Tutorial: Basics of C++</strong><br />
<center><br />
<a href="http://technotip.com/1053/object-oriented-programming-c/"><img src="http://img.youtube.com/vi/GuZFpc0diJ4&#038;ap=%2526fmt%3D22/default.jpg" width="130" height="97" border title="Object Oriented Programming: C++" alt="default Object Oriented Programming: C++" /></a><br />
</center></p>
<div style="font-size: small;">YouTube Link: <a href="http://www.youtube.com/watch?v=GuZFpc0diJ4&#038;fmt=22">http://www.youtube.com/watch?v=GuZFpc0diJ4</a> [Watch the Video In Full Screen.]</div>
<p><br style="clear: both;" /><br />
</p>
<p><b>Class In Cpp:</b></p>
<pre name="code" class="cpp">
#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;

class Student
{
  int a, b, c;

  public:
  void read() { cin&gt;&gt;a&gt;&gt;b&gt;&gt;c; }
  void show() { cout&lt;&lt;"\nEntered Numbers are "&lt;&lt;a&lt;&lt;" , "&lt;&lt;b&lt;&lt;" , "&lt;&lt;c; }
};

int main()
{
  A a;
  clrscr();

  cout&lt;&lt;"\nEnter 3 nums\n";

  a.read();
  a.show();

  getch();

}
</pre>
<p>member functions are accessed with the help of objects.</p>
<p>object.member</p>
<p>This way data binding is done and a level of security is imparted to the data.</p>
<p>Binding of Data and method into a single unit is called <strong>ENCAPSULATION</strong>.</p>
<p>Related posts:<ol>
<li><a href='http://technotip.com/662/first-java-program-basic/' rel='bookmark' title='First Java Program: Basic'>First Java Program: Basic</a></li>
<li><a href='http://technotip.com/262/event-object-javascript/' rel='bookmark' title='Event Object: Javascript'>Event Object: Javascript</a></li>
<li><a href='http://technotip.com/673/using-constructors-member-function-to-add-two-numbers-java/' rel='bookmark' title='Using Constructors &amp; Member Function to add two numbers: Java'>Using Constructors &#038; Member Function to add two numbers: Java</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://technotip.com/1053/object-oriented-programming-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Colorful Text Output: C program</title>
		<link>http://technotip.com/984/colorful-text-output-c-program/</link>
		<comments>http://technotip.com/984/colorful-text-output-c-program/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 14:36:30 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[graphics]]></category>

		<guid isPermaLink="false">http://technotip.com/?p=984</guid>
		<description><![CDATA[This video tutorial shows a simple method to get the output in different colors, on the dosprompt: using a simple C program. Video Tutorial: Colorful Text Output: C program YouTube Link: http://www.youtube.com/watch?v=TpasN_6RMMM [Watch the Video In Full Screen.] Full Source code: Colorful Text Output: C program C 1 2 3 4 5 6 7 8 [...]
Related posts:<ol>
<li><a href='http://technotip.com/780/simple-interest-c-program/' rel='bookmark' title='Simple Interest: C Program'>Simple Interest: C Program</a></li>
<li><a href='http://technotip.com/957/write-data-to-text-file-in-c-character-by-character/' rel='bookmark' title='Write Data To Text File In C: Character by Character'>Write Data To Text File In C: Character by Character</a></li>
<li><a href='http://technotip.com/662/first-java-program-basic/' rel='bookmark' title='First Java Program: Basic'>First Java Program: Basic</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This video tutorial shows a simple method to get the output in different colors, on the dosprompt: using a simple C program.</p>
<p><strong>Video Tutorial: Colorful Text Output: C program</strong><br />
<center><br />
<a href="http://technotip.com/984/colorful-text-output-c-program/"><img src="http://img.youtube.com/vi/TpasN_6RMMM/default.jpg" width="130" height="97" border title="Colorful Text Output: C program" alt="default Colorful Text Output: C program" /></a><br />
</center></p>
<div style="font-size: small;">YouTube Link: <a href="http://www.youtube.com/watch?v=TpasN_6RMMM">http://www.youtube.com/watch?v=TpasN_6RMMM</a> [Watch the Video In Full Screen.]</div>
<p><br style="clear: both;" /><br />
</p>
<p><strong>Full Source code: Colorful Text Output: C program C</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">#include&lt; stdio.h&gt; /* Leave No space b/w &lt; and stdio.h */
&nbsp;
void main()
{
	int i;
	clrscr();
&nbsp;
	for( i=0; i&lt;=15; i++ )
	{
		textcolor(i);
		cprintf(&quot;Microsoft, Google, Yahoo, Oracle, eBay, PayPal \r\n&quot;);
	}
&nbsp;
	getch();
&nbsp;
}</pre></td></tr></table></div>

<p><strong>textcolor()</strong> function takes color code as it&#8217;s parameter, and this color is taken by <strong>cprintf()</strong> function and the parameter(string) passed to <strong>cprintf </strong>is printed in the color given by <strong>textcolor()</strong> function.</p>
<table style="font-weight: normal;">
<tr>
<th>
Color Name<br />
&#8212;&#8212;&#8212;-
</th>
<th>
Color code<br />
&#8212;&#8212;&#8212;-
</th>
</tr>
<tr>
<td>
BLACK<br />
BLUE<br />
GREEN<br />
CYAN<br />
RED<br />
MAGENTA<br />
BROWN<br />
LIGHTGRAY<br />
DARKGRAY<br />
LIGHTBLUE<br />
LIGHTGREEN<br />
LIGHTCYAN<br />
LIGHTRED<br />
LIGHTMAGENTA<br />
YELLOW<br />
WHITE
</td>
<td>
0<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
10<br />
11<br />
12<br />
13<br />
14<br />
15
</td>
</tr>
</table>
<p><strong>OutPut:</strong><br />
<span style="color: black;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: blue;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: green;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: cyan;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: red;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: magenta;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: brown;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: lightgray;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: darkgray;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: lightblue;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: lightgreen;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: lightcyan;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: lightred;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: lightmagenta;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: yellow;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span><br />
<span style="color: white;">Microsoft, Google, Yahoo, Oracle, eBay, PayPal</span></pre>
<p>Related posts:<ol>
<li><a href='http://technotip.com/780/simple-interest-c-program/' rel='bookmark' title='Simple Interest: C Program'>Simple Interest: C Program</a></li>
<li><a href='http://technotip.com/957/write-data-to-text-file-in-c-character-by-character/' rel='bookmark' title='Write Data To Text File In C: Character by Character'>Write Data To Text File In C: Character by Character</a></li>
<li><a href='http://technotip.com/662/first-java-program-basic/' rel='bookmark' title='First Java Program: Basic'>First Java Program: Basic</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://technotip.com/984/colorful-text-output-c-program/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

