Grab the widget  Get Widgets

12 October 2011

Learn C !!

Do you need to find out area of circles,In a click??Do it With C programing.
To do this you need to download a c compiler[I used Codeblocks.It's a free software and you can download it by these Links--

CodeBlock 8.02 for Windows [10.8Mb]
Codeblocks-8.02mingw for windows [19.3Mb]
Codeblocks_8.02-0ubuntu1.deb.tar.gz(for linux 32 bit)[20.1Mb]
Codeblocks-8.02-amd64.tar.gz(for linux 64bit[20.3Mb]
Codeblocks-8.02-mac.zip for Mac[19.6Mb]
Download Codeblocks using any of the links suites for you,install it to your hard drive;click on "New">Empty project and write down these codes;

#include <stdio.h>
#include <conio.h>
#include <ctype.h>
void main()
{
float area, radius, pi;
char ch;
pi = 3.14159;
printf(“\n Do you want to calculate area of a circle? (y/n) :”);
ch = getch();
ch = toupper(ch);
while( ch != ‘N’)
{ printf(“\n What is the Radius of your circle?: “);
scanf(“%f”, &radius);
area = pi * radius * radius;
printf(“\n\n Area of This circle is: %.2f.”, area);
printf(\n\n\n Do you want to calculate area of a circle? (y/n :”);
ch = getch();
ch = toupper (ch);
}
}

No comments:

Post a Comment