Saturday, 3 September 2011

Using Data types in c++

#include<iostream.h>
#include<conio.h>
void main()
{
        int num;
        char ch;
        float f;
        double d;
        num = 2;
        ch = 'a';
        f = 12.5;
       d = 12543.9;
       cout<<"integer = "<<num<<endl;
       cout<<"character = "<<ch<<endl;
       cout<<"floating number = "<<f<<endl;
       cout<<"double = "<<d<<endl;
}

No comments:

Post a Comment

Note: only a member of this blog may post a comment.