Author Topic: Turbo C Program for (a + b) ^ 2  (Read 898 times)

kathir

  • Administrator
  • Sr. Member
  • *****
  • Posts: 283
Turbo C Program for (a + b) ^ 2
« on: February 10, 2012, 06:36:11 pm »
Here is the turbo c program for (a + b) ^ 2.

Code:
//Source Code Listing


#include <stdio.h>
#include <conio.h>

void main()
{
     int a, b, result;
     printf("Enter A: ");
     scanf("%d", &a);
     printf("Enter B: ");
     scanf("%d", &b);

     result = (a+b) * (a+b);

    printf("The answer is: %d", result);

}



Sample Output:

Enter A: 5
Enter B: 3
The answer is: 64

 


Disclaimer: This web site is for educational and informational purposes only. Click here to read the Disclaimer.
Content copyright 2010-2014. Kathiresan. All rights reserved.
This page is using SMF version 2.0.1