Saturday, August 31, 2019

C Language Program for Find largest From Three Number.


BACHELOR OF COMPUTER APPLICATION (B.C.A.) FIRST SEMESTER



Here you will get simple C program 
C Language Program for Find The Largest From Three No’s..
IT IS THE SMALLEST LOGIC USED FOR CODING OF THIS PROGRAM.
IN WHICH YOU CAN CREATE OWN VARIABLES AND FUNCTIONS.
User will input three numbers and
then their Largest number will be calculated and
finally it will be printed on screen.

The program coding is given below.
#include<stdio.h>
#include<conio.h>
void main()
{
 int a,b,c;
 clrscr();
 printf("Enter Any Three Value's = ");
 scanf("%d %d %d",&a,&b,&c);
 if((a>b)&&(a>c))
 {
  printf("A is Largest Number");
 }
 if (b>c)
 {
  printf("B is Largest Number");
 }
 else
 {
  printf("C is Largest Number");
 }
 getch();
}
Output will be given after you compile it.

HOW TO CREATE AN CALCULATOR USING VB PROGRAMMING.



Hi Friends Today i will show you how you can be Create an Calculator in VB(Visual Basic 6.0)


  • To Make An Calculator you need to insert Two Label Control's.
  • And another Control's need to insert is  Two Text box Control.
  • Four Command button is placed to the form.
  • As Shown in Picture Arrange it.
  • Also Placed Another Label for Output or Display of Calculation of Simple Calculator. 
  • In this Example I used default names of Control.  

Coding of Calculator

Private Sub Command1_Click(Index As Integer)
If Index = 0 Then
    Label3.Caption = Val(Text1.Text) + Val(Text2.Text)
ElseIf Index = 1 Then
    Label3.Caption = Val(Text1.Text) - Val(Text2.Text)
ElseIf Index = 2 Then
    Label3.Caption = Val(Text1.Text) * Val(Text2.Text)
Else
    Label3.Caption = Val(Text1.Text) / Val(Text2.Text)
End If
End Sub
Code Window of Calculator
  
Output View of Calculator
Design View of Calculator

Thursday, August 29, 2019

C++ Language Program for Sort Two Array in Merge Sort.


BACHELOR OF COMPUTER APPLICATION (B.C.A.) FIRST SEMESTER

Here you will get simple C++ program 
C++ Language Program Sort Two Array in Merge Sort.
IT IS THE SMALLEST LOGIC USED FOR CODING OF THIS PROGRAM.
IN WHICH YOU CAN CREATE OWN VARIABLES AND FUNCTIONS.

User will input will be an unsorted form in Two Array(A&B) and that C Array is sorted by Merge Sort,then it will be display on screen.


The program coding is given below.
#include <iostream.h>
#include <conio.h>
class Abc
{
int a[10],b[10],c[10],R,S,N,NA,NB,PTR;
public:
void getdata()
{
cout<<"Enter Array A Size: ";
cin>>R;
cout<<"Enter Array A: ";
for (int i=1; i<=R; i++)
{
cin>>a[i];
}
cout<<"Enter Array B Size: ";
cin>>S;
cout<<"Enter Array B: ";
for (int j=1; j<=S; j++)
{
cin>>b[j];
}
N=R+S;
}
void msort()
{
NA=NB=PTR=1;
while(NA<=R && NB<=S)
{
if (a[NA]<b[NB])
{
c[PTR]=a[NA];
PTR++;
NA++;
}
else
{
c[PTR]=b[NB];
PTR++;
NB++;
}
}
if (NA>R)
{
for (int k=0; k<=S-NB; k++)
{
c[PTR+k]=b[NB+k];
}
}
else
{
for (int k=0; k<=R-NA; k++)
{
c[PTR+k]=a[NA+k];
}
}
}
void display()
{
cout<<"\nArray C:";
for (int k=1; k<=N; k++)
{
cout<<c[k]<<" ";
}
}
};
void main()
{
clrscr();
Abc a1;
a1.getdata();
a1.msort();
a1.display();
getch();
}
Output will be given after you compile it.

Wednesday, August 28, 2019

C++ Language Program for Sort in Insertion Sort.



BACHELOR OF COMPUTER APPLICATION (B.C.A.) FIRST SEMESTER

Here you will get simple C++ program 
C++ Language Program for Sort in Insertion Sort.
IT IS THE SMALLEST LOGIC USED FOR CODING OF THIS PROGRAM.
IN WHICH YOU CAN CREATE OWN VARIABLES AND FUNCTIONS.

User will input will be an unsorted form in Array and that array is sorted by Insertion Sort,then it will be display on screen.


The program coding is given below.
#include <iostream.h>
#include <conio.h>
class Abc
{
int a[10],N,PTR,TEMP;
public:
void getdata()
{
cout<<"Enter N: ";
cin>>N;
cout<<"Enter Elements: ";
for (int i=1;i<=N;i++)
{
cin>>a[i];
}
}
void insert()
{
a[0]=0;
for (int k=2;k<=N;k++)
{
TEMP=a[k];
PTR=k-1;
while(TEMP<a[PTR])
{
a[PTR+1]=a[PTR];
PTR=PTR-1;
}
a[PTR+1]=TEMP;
}
}
void display()
{
cout<<"\nInsertion Sort\n";
for (int i=1;i<=N;i++)
{
cout<<a[i]<<" ";
}
}
};
void main()
{
clrscr();
Abc a1;
a1.getdata();
a1.insert();
a1.display();
getch();
}
Output will be given after you compile it.

Tuesday, August 27, 2019

C++ Language Program for Sort in Selection Sort.


BACHELOR OF COMPUTER APPLICATION (B.C.A.) FIRST SEMESTER

Here you will get simple C++ program 
C++ Language Program for Sort in Selection Sort.
IT IS THE SMALLEST LOGIC USED FOR CODING OF THIS PROGRAM.
IN WHICH YOU CAN CREATE OWN VARIABLES AND FUNCTIONS.

User will input will be an unsorted form in Array and that array is sorted by Selection Sort,then it will be display on screen.


The program coding is given below.
#include <iostream.h>
#include <conio.h>
class Abc
{
int A[10],MIN,LOC;
public:
void getdata()
{
cout<<"Enter Elements: ";
for (int i=1;i<=5;i++)
{
cin>>A[i];
}
}
void min(int k)
{
MIN=A[k];
LOC=k;
for (int j=k+1;j<=5;j++)
{
if (MIN>A[j])
{
MIN=A[j];
LOC=j;
}
}
}
void selection()
{
int temp;
for (int k=1;k<=4;k++)
{
min(k);
temp=A[k];
A[k]=A[LOC];
A[LOC]=temp;
}
}
void display()
{
cout<<"\nSelection Sort:\n";
for (int i=1;i<=5;i++)
{
cout<<A[i]<<" ";
}
}
};
void main()
{
clrscr();
Abc a1;
a1.getdata();
a1.selection();
a1.display();
getch();
}
Output will be given after you compile it.