Skip to main content

Posts

Showing posts from 2011

Calculating the average of two numbers using C++

Though this site aims at understanding C language, I am writing a program for you in C++, to have a general idea about C++ too. A program in C++,to calculate the average of two numbers, which are entered by the keyboard while the execution of the program. Try to understand the program; #include &lt iostream &gt using namespace std; int main() {     float num1,num2,average,sum;     cout << "Enter the first number:";     cin >> num1;     cout << "Enter the second number:";     cin >> num2;     sum=num1+num2;     average=sum/2;     cout << "The sum of the two numbers is:"<< sum<<"\n"<<"The average of the two numbers is:" << average; return(0); } Explaination: The new file header used here in this C++ program is the #include . By this , we are asking the preprocessor to add the contents of the iostream file to our program. The program is written in the

C Reference app on Android

Android is one of the most rapidly growing mobile platform today. Most of us are opting for android devices , cell phones /tablets and so am I . While surfing around the Android Market (The place to download android apps) I came across an helpful app; " C Reference ".                                This app provides the reference to the standard C library. It also contains description of all the functions and macros in C, in a searchable from. This app could be very handy in while writing C programs.And the best part about this app is that , this app can be downloaded free from the android market. Screenshots: You can see and download this app from C Reference App