Wednesday, 1 October 2014

ASSIGNMENT : 3 - I (Prime no. USING while LOOP)

//            SEAT NO. :
//            ASSIGNMENT  :  3 - I (USING while LOOP)

//            PROGRAM  TO FIND OUT NO IS PRIME OR NOT USING while LOOP

#include<iostream.h>
#include<conio.h>

int main()
{
                int no;
                int is_prime = 1;
                clrscr();

                cout<<"\n Enter any no. : ";
                cin>>no;

                int temp=no/2;
                int i=2;

                while(i <= temp)
                {
                                if(no%i == 0)
                                {
                                                is_prime = 0;
                                                break;
                                }
                                i++;
                }

                if(is_prime == 1)
                {
                                cout<<"\n "<<no<<" is a prime no.";
                }
                else
                {
                                cout<<"\n "<<no<<" is not a prime no.";
                }
                getch();
                return 0;

}

Tuesday, 30 September 2014

ASSIGNMENT : 2 - IV (USING switch-case)

//            SEAT NO. :
//            ASSIGNMENT NO. :  2 -IV (USING switch-case)

//            PROGRAM USING SIMPLE switch-case STATEMENT
//            PROGRAM TO PRINT ROMAN EQUIVALENT OF 1 TO 10 NUMBERS
//            (1=I  2=II  3=III  4=IV  5=V  6=VI  7=VII  8=VIII  9=IX  10=X)

#include<iostream.h>
#include<conio.h>

int main()
{
                int no;
                clrscr();
                cout<<"\n Please enter any no. between 1 to 10 : ";
                cin>>no;

                switch(no)
                {
                                case 1 :
                                                cout<<"\n Roman equivalent of "<<no<<" is I";
                                                break;
                                case 2 :
                                                cout<<"\n Roman equivalent of "<<no<<" isII";
                                                break;
                                case 3 :
                                                cout<<"\n Roman equivalent of "<<no<<" is III";
                                                break;
                                case 4 :
                                                cout<<"\n Roman equivalent of "<<no<<" is IV";
                                                break;
                                case 5 :
                                                cout<<"\n Roman equivalent of "<<no<<" is V";
                                                break;
                                case 6 :
                                                cout<<"\n Roman equivalent of "<<no<<" is VI";
                                                break;
                                case 7 :
                                                cout<<"\n Roman equivalent of "<<no<<" is VII";
                                                break;
                                case 8 :
                                                cout<<"\n Roman equivalent of "<<no<<" is VIII";
                                                break;
                                case 9 :
                                                cout<<"\n Roman equivalent of "<<no<<" is IX";
                                                break;
                                case 10 :
                                                cout<<"\n Roman equivalent of "<<no<<" is X";
                                                break;
                                default :
                                                cout<<"\n "<<no<<" is not between 1 to 10";
                }
                getch();
                return 0;

}

ASSIGNMENT : 2 -III (USING NESTED if..else)

//            SEAT NO. :
//            ASSIGNMENT NO. :  2 - III (USING NESTTED if..else)


//            PROGRAM USING NESTED if..ele STATEMENT
//            PROGRAM TO READ MARKS OF STUDENT AND FINDOUT HIS/HER GRADE

#include<iostream.h>
#include<conio.h>

int main()
{
                int marks;
                clrscr();
                cout<<"\n Please enter your marks : ";
                cin>>marks;

                //            NOW HERE WE FIND OUT GRADE USING NESTED if...else
                if(marks >= 100)
                {
                                cout<<"\n Invalid marks ";
                }
                else
                {
                                if(marks >= 75)
                                {
                                                cout<<"\n A+ Grade";
                                }
                                else
                                {
                                                if(marks>=60)
                                                {
                                                                cout<<"\n A Grade";
                                                }
                                                else
                                                {
                                                                if(marks >= 50)
                                                                {
                                                                                cout<<"\n B Grade";
                                                                }
                                                                else
                                                                {
                                                                                if(marks>=45)
                                                                                {
                                                                                                cout<<"\n C Grade";
                                                                                }
                                                                                else
                                                                                {
                                                                                                cout<<"\n I am sorry, You are Fail";
                                                                                }
                                                                }
                                                }
                                }
                }

                getch();
                return 0;

}

Monday, 29 September 2014

ASSIGNMENT : 2 - II (USING IF...ELSE)

//            SEAT NO. :
//            ASSIGNMENT NO. : 2 - II (USING IF...ELSE)

//            PROGRAM TO FIND OUT LARGER OF 2 NUMBER

#include<iostream.h>
#include<conio.h>

int main()
{
                int no1, no2;
                clrscr();

                cout<<"\n Please enter any two integer no. : ";
                cin>>no1>>no2;

                if(no1>no2)
                {
                                cout<<"\n\t "<<no1<<" is greter than "<<no2;
                }
                else
                {
                                cout<<"\n\t "<<no2<<" is gretter than "<<no1;
                }

                getch();
                return 0;

}

ASSIGNMENT : 2 - I (USING SIMPLE IF STATEMENT)

//            SEAT NO. :
//            ASSIGNMENT NO. : 2 - I  (USING SIMPLE IF STATEMENT)

//            PROGRAM TO CHECK TWO NUMBERS FOR EQUALITY

#include<iostream.h>
#include<conio.h>

void main()
{
                int no1, no2;
                clrscr();

                cout<<"\n Please enter any two integer no. : ";
                cin>>no1>>no2;

                if(no1 == no2)
                {
                                //            IF CONDITION IS TRUE THEN THIS PART IS EXECUTE
                                cout<<"\n\t"<<no1<<" and "<<no2<<" are equal...!!!";
                }

                cout<<"\n\t Back to main function ";

                getch();

}

ASSIGNMENT : 1 (PROGRAM TO DEMONSTRATE USE OF ARITHMETIC OPERATORS)

//            ASSIGNMENT  :  1
//            PROGRAM TO DEMONSTRATE USE OF ARITHMETIC OPERATORS
//            +   -   *   /   %

#include<iostream.h>
#include<conio.h>

void main()
{
                int a, b, c;
                float x;
                clrscr();
                a = 30;
                b = 7;

                c = a + b;
                cout<<"\n Addition of "<<a<<" and "<<b<<" = "<<c;

                c = a - b;
                cout<<"\n Substraction of "<<a<<" and "<<b<<" = "<<c;

                c = a * b;
                cout<<"\n Multiplication of "<<a<<" and "<<b<<" = "<<c;

                c = a / b;
                cout<<"\n Devision of "<<a<<" and "<<b<<" = "<<c;

                c = a % b;
                cout<<"\n Modulo of "<<a<<" and "<<b<<" = "<<c;

                getch();
}

//            OUTPUT
/*
 Addition of 30 and 7 = 37
 Substraction of 30 and 7 = 23
 Multiplication of 30 and 7 = 210
 Devision of 30 and 7 = 4
 Modulo of 30 and 7 = 2

*/

Syllabus for BCA-I (C++ LAB)

North Maharashtra University, Jalgaon

Faculty of Commerce and Management
BACHELOR OF COMPUTER APPLICATIONS (BCA)
BCA 17 : Practical on C++ Part I
w.e.f. 2014-15

Total Lectures: 48
[Total Marks: 60 External + 40 Internal =100 Marks]


Objective - To practically train students in developing programing and logical skills using
C++ programing language.

1. Program using various arithmetic operators.

2. Program using control statements. (if, if else, nested if, switch)

3. Program using various looping structure ( for, while, do-while)
    (Programs like prime number, factorial of a number, Fibonacci series)

4. Program using arrays (One dimension, Two dimensions)

5. Write a program to demonstrate use of function.
(call by value, call by reference, recursive function)

6. Write a program to demonstrate use various string functions.

7. Write a program to demonstrate use of pointers.

8. Write a program to demonstrate use of structure and union.