53) Example of check box control?

Follow the following step for creative check box control on the form. Follow the following step to design and run the application – (i) Open the visual basic project and place two frames and change caption of first frame as option button and second frame as check boxes. Insert three option button inside first frame … Continue reading 53) Example of check box control?

Advertisements

52) Design a form and write function program in visual basic to calculate a formula (a2+2ab+b2) using define function?

Private Function Calculate(ByVal a As Integer, ByVal b As Integer) As Integer     Calculate = (a ^ 2 + 2 * a * b + b ^ 2) End Function Private Sub Command1_Click()     Dim a, b, c As Integer     a = Val(Text1.Text)     b = Val(Text2.Text)     c = Calculate(a, b)     Text3.Text … Continue reading 52) Design a form and write function program in visual basic to calculate a formula (a2+2ab+b2) using define function?

51) Design a form and write function program to add two integer number?

Private Function Sum(ByVal x As Integer, ByVal y As Integer) As Integer     Sum = (x + y) End Function Private Sub Command1_Click()     Dim a, b, s As Integer     a = Val(Text1.Text)     b = Val(Text2.Text)     s = Sum(a, b)     Text3.Text = s End Sub Private Sub Command2_Click()     End End … Continue reading 51) Design a form and write function program to add two integer number?

102. Write a program to transpose (Interchange) of 2-D array?

#include<iostream.h> #include<conio.h> void main() {                 int a[4][5],t[5][4],i,j;                 clrscr();                 for(i=0;i<4;i++)                                 {                                 for(j=0;j<5;j++)                                                 {                                                 cout<<"Enter The Value of A["<<i<<"]["<<j<<"] = ";                                                 cin>>a[i][j];                                                 }                                 }                 clrscr();                 cout<<"\tBefore Transposition of Matrix : \n";                 for(i=0;i<4;i++)                                 {                                 for(j=0;j<5;j++)                                                 {                                                 cout<<a[i][j]<<" ";                                                 }                                 … Continue reading 102. Write a program to transpose (Interchange) of 2-D array?

101. Write a program to print the Pascal’s triangle for a given number as a row?

There are following rules must be made – Using 2-D array we can generate the Pascal’s triangle. The element at first column (Column Zero) must be filled up with one. The element which correspond to the same row and column will be filled up with one. Rest of the elements will be filled up with … Continue reading 101. Write a program to print the Pascal’s triangle for a given number as a row?

100. Write a program to perform multiplication of two square matrices?

#include<iostream.h> #include<conio.h> void main() {                 int a[2][2],b[2][2],c[2][2],i,j,k;                 clrscr();                 cout<<"Enter The Value for A Matrix : \n";                 for(i=0;i<2;i++)                                 {                                 for(j=0;j<2;j++)                                                 {                                                 cout<<"A["<<i<<"]["<<j<<"] = ";                                                 cin>>a[i][j];                                                 }                                 }                 cout<<"Enter The Value for B Matrix : \n";                 for(i=0;i<2;i++)                                 {                                 for(j=0;j<2;j++)                                                 {                                                 … Continue reading 100. Write a program to perform multiplication of two square matrices?

99. Write a program to perform addition of two matrices?

#include<iostream.h> #include<conio.h> void main() {                 int a[3][3],b[3][3],c[3][3],i,j;                 clrscr();                 cout<<"\tEnter First Array : \n";                 for(i=0;i<3;i++)                                 {                                 for(j=0;j<3;j++)                                                 {                                                 cout<<"A["<<i<<"]["<<j<<"] = ";                                                 cin>>a[i][j];                                                 }                                 }                 cout<<"\tEnter Second Array : \n";                 for(i=0;i<3;i++)                                 {                                 for(j=0;j<3;j++)                                                 {                                                 cout<<"B["<<i<<"]["<<j<<"] = ";                                                 cin>>b[i][j];                                                 … Continue reading 99. Write a program to perform addition of two matrices?

98. Write a program to read and display the value of 2-D array?

#include<iostream.h> #include<conio.h> void main() {                 int i,j,a[3][4];                 clrscr();                 for(i=0;i<3;i++)                                 {                                 for(j=0;j<4;j++)                                                 {                                                 cout<<"Enter Value of A["<<i<<"]["<<j<<"] = ";                                                 cin>>a[i][j];                                                 }                                 }                 for(i=0;i<3;i++)                                 {                                 for(j=0;j<4;j++)                                                 {                                                 cout<<"\nThe Entered Value of A["<<i<<"]["<<j<<"] = "<<a[i][j];                                                 }                                 }                 getch(); }

97. Write a program to perform square of every element of an array by passing whole array to a function?

#include<iostream.h> #include<conio.h> void square(int *,int); void main() {                 int a[10],i,n;                 clrscr();                 cout<<"Enter The Number of Element : ";                 cin>>n;                 for(i=0;i<n;i++)                                 {                                 cout<<"Enter The Element For A["<<i<<"] = ";                                 cin>>a[i];                                 }                 cout<<"\tBefore Passing Array To Function In Main() : \n";                 for(i=0;i<n;i++)                                 {                                 cout<<"A["<<i<<"] … Continue reading 97. Write a program to perform square of every element of an array by passing whole array to a function?

96. Write a program in C++ to addition of two array using third array?

#include<iostream.h> #include<conio.h> void main() {                 int i,n,a[10],b[10],c[10];                 clrscr();                 cout<<"Enter The Number of Element In Array : ";                 cin>>n;                 cout<<"\tEnter First Array \n";                 for(i=0;i<n;i++)                                 {                                 cout<<"A["<<i<<"] = ";                                 cin>>a[i];                                 }                 cout<<"\tEnter Second Array \n";                 for(i=0;i<n;i++)                                 {                                 cout<<"B["<<i<<"] = ";                                 cin>>b[i];                                 … Continue reading 96. Write a program in C++ to addition of two array using third array?