Home » Archive

Articles in the C and C++ Category

C and C++, Tech Corner »

[15 Jul 2009 | No Comment | Posted By:Dileep]

Data can be provided to the program variables in two ways – non-interactive method & interactive input method.
stdio – standard input-output libraray.
Two types of i/o functions - Formatted i/o functions & Unformatted i/o functions

scanf() – formatted i/p function.
scanf(“control-string”, address_list);
scanf(“%[^\n]“, message); //go on typing any ASCII printable characters till the new line(\n) character is pressed.

printf() – formatted o/p function.
printf(“control-string”, address_list);

Unformatted input functions – getchar(), gets()
Unformatted output functions – putchar(), puts()

Program 1
//C program to accept 3 numbers and compute their sum and average
#include<stdio.h>
void main()
{
int num1,num2,num3,sum;
float averag;
printf(“Enter Three Numbers\n”);
scanf(“%d %d %d”,&num1,&num2,&num3);
sum=num1+num2+num3;
averag=sum/3.0;
printf(“Sum = %d\nAverage = %f\n”,sum,averag);
}
Program 2
/*Program …

Read the full Post »

C and C++, Tech Corner »

[14 Jul 2009 | No Comment | Posted By:Dileep]

Constants
The quantity which does not change during the execution of a program is known as a constant.
Variables
The quantity that changes during the execution of a program is called a variable.
Also caled identifiers.

Read the full Post »

C and C++, Tech Corner »

[11 Jul 2009 | No Comment | Posted By:Dileep]

Used to develop both application programs and system programs.
Is a high-level programing language.
Is both a general purpose and a specific purpoes programing language.
Most popular and common programming language.
Developed at Bell Telephone Laboratory, USA(Now AT&T) in 1972.
By Dennis Ritchie & Brian Kerninghan

Characteristics of C

C is a general-purpose programing language.
It is a structured programing language.
Helps in the development of system programs.
Has a rich set of operators.
Provides compact representation for expressions.
Allows manipulation of internal processor registers.
Has no rigid format. Any number of statements can be typed in a single line.
Portability.
Supports a rich set …

Read the full Post »