Sunday 20 March, 2011

Basic Commands

C statement
Printf(“%d”,a); //to print variable "a"

Equivalent C++ statement
Cout<<a;

C statement
Scanf(“%f”,&average); //to get the value and store in vaiable "average"

Equivalent C++ statement
Cin>>average;

C statement
Printf(“total is %d this ”,sum);//to print the variable 'sum'

Equivalent C++ statement
Cout<<“totalis“<<sum<<“ this”;

C statement
Scanf(“%d %f”,&a,&x);//to get and store the value of vaeiables 'a' and 'x'

Equivalent C++ statement
Cin>>a>>x;

No comments:

Post a Comment