Basic C++ Programs.

C is high-level and general purpose programming language that is ideal for developing firmware or portable applications. Originally intended for writing system software, C was developed at Bell Labs by Dennis Ritchie for the Unix Operating System (OS) in the early 1970s. Here are the following basic C++ programs for beginners. 

/* Write a program to subtract of two numbers*/


#include <stdio.h>
#include <conio.h>
void main()
{
   int a,b,c
printf("enter the value of a & b");
scanf("%d%d",&a&b);
   c=a-b;
printf("c=%d" c);
getch();
            }

/*Write a program to find the area of circle*/



#include <stdio.h>
#include <conio.h>
void main
{
   float r,a,pi=3.14
printf("Enter the value of r");
scanf("%f",&r);
   a=pi*r*r;
printf("a=%f" a);
getch();
            }

No comments

Powered by Blogger.