BCA Raipur - BCA Notes S-1

Post your notes and other just by mailing us at bcaraipur@live.com

BCA Raipur - BCA Notes S-2

Post your notes and other just by mailing us at bcaraipur@live.com

BCA Raipur - BCA Notes S-3

Post your notes and other just by mailing us at bcaraipur@live.com

BCA Raipur - BCA Notes S-4

Post your notes and other just by mailing us at bcaraipur@live.com

BCA Raipur - BCA Notes S-5

Post your notes and other just by mailing us at bcaraipur@live.com

google search

Popular Posts


Welcome to BCA Notes

>>>>>>>>>>>>>>>>

Visitors

Search This Blog

Blogger templates

Visitor Map


Saturday 19 April 2014

Reverse any number using c program

//Reverse any number using c program

#include<stdio.h>
int main(){
    int num,r,reverse=0;

    printf("Enter any number: ");
    scanf("%d",&num);

    while(num){
         r=num%10;
         reverse=reverse*10+r;
         num=num/10;
    }

    printf("Reversed of number: %d",reverse);
    return 0;
}

Sample output:
Enter any number: 12
Reversed of number: 21

Tuesday 15 April 2014

publi class private class use

#include<conio.h>
#include<iostream.h>
class student
{
    private:
        char name[20];
    public:
        void getname()
        {
        cout<<"\nEnter Name:";
        cin.getline(name,20);
        }
};
class roll: public student
{
    private:
        int rn;
    public:
        void getrn()
        {
        getname();
        cout<<"\nRoll No.:";
        cin>>rn;
        }
};
class cor: public roll
{
    private:
        char course[10];
    public:
        void getcourse()
        {
        getrn();
        cout<<"\nCourse Name:";
        cin>>course;
        }
    void display()
    {
        cout<<name;
    }
};
void main()
    {
        clrscr();
        cor d;
        d.getcourse();
        d.display();
        getch();
    }

program to find area of Rectanglein c++

#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{

int a,b,c;
clrscr();
cout<<"\n\tEnter Lenght:";
cin>>a;
cout<<"\n\tEnter Width:";
cin>>b;
c=a*b;
cout<<"Area of Rectangle ="<<c;
getch();

}

Program check the length of string without using string function i c++

#include<stdio.h>
#include<conio.h>
#include<iostream.h>
void main()
{
char str[50];
int i;
clrscr();
cout<<"\n"<<"Enter a String: ";
cin.getline(str,50);
cout<<"\n"<<str<<"\n";
for(i=0;str[i]!='\0';i++);
cout<<i;
getch();

}

reverse of a string without using string functions

#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{
char str[50];
int i;
clrscr();
cout<<"\n"<<"Enter a String: ";
cin.getline(str,50);
cout<<"\n"<<str<<"\n";
for(i=0;str[i]!='\0';i++);
cout<<"\nLength of String :"<<i;
for(;i!=-1;i--)
{
cout<<str[i];
}


getch();
}

Thursday 3 April 2014

Structure in c++

#include<iostream.h>
struct stud
{
        char *name;
        int age;
};
main()
{
        struct stud s[3]={{"kunal",18},{"sachin",18},{"khushal",18}};
        for(int i=0;i<3;i++)
        {
                cout<<s[i].name<<endl;
                cout<<s[i].age<<endl;
        }

}