Question about Compilers & Programming Tools

__Program for deletion__

#include<iostream.h>

void main()

{

int a[10],i,n,x;

cout<<"\n\t\tPROGRAM TO DELETE AN NUMBER FROM AN ARRAY";

cout<<"\nEnter the size of the array:";

cin>>n;

for(i=0;i<n;i++)

{

cout<<"\nEnter the number:";

cin>>a[i];

}

cout<<"\nEnter the position to be deleted:";

cin>>x;

for(i=x;i<n;i++)

a[i]=a[i+1];

for(i=0;i<n-1;i++)

cout<<a[i]<<" ";

}

Posted on Mar 08, 2009

I need a combination code insrtion, deletion , serching and sortiong code...

Posted on Jul 18, 2009

You could do this by creating two arrays as such:

int firstArray[5]; int secondArray[5]

and then the sum variable:

int sum = 0;

then you could do a for loop to find the sum of the second array:

int firstArray[5]; int secondArray[5]

and then the sum variable:

int sum = 0;

then you could do a for loop to find the sum of the second array:

Feb 22, 2011 | Microsoft Visual C++ Professional Edition...

pseudo is

-> integer type count =0;

->Take input from user 'Number'

->loop from 0th to 24th element

->Compare each element with user entered number and if it matches then do count++.

finally display the count.

-> integer type count =0;

->Take input from user 'Number'

->loop from 0th to 24th element

->Compare each element with user entered number and if it matches then do count++.

finally display the count.

Jul 29, 2010 | Advanced Graphics Programming Using OpenGL...

samples of arrays in vb.net

1)

dim array(3) as integer

array(0)=1

array(1)=2

array(2)=3

array(3)=4

2) dim array() as integer

array=new integer(){1,2,3,4}

3) for two dimensional arrays add comma separation to the size

1)

dim array(3) as integer

array(0)=1

array(1)=2

array(2)=3

array(3)=4

2) dim array() as integer

array=new integer(){1,2,3,4}

3) for two dimensional arrays add comma separation to the size

May 28, 2010 | Microsoft Visual Basic Enterprise Edition...

coding in C++

#include<iostream.h>

#include<conio.h>

#define max 50

void main()

{

clrscr();

int arr[max],size=0;

int i=0,j=0,temp;

do

{

cout<<"Enter the size of array(less than or equal to 50)";

cin>>size;

} while(size>50);

for(i=0;i<size;i++){

cout<<"Enter a number";

cin>>arr[i];

}

for( i=1;i<size;i++){

for(j=0;j<size;j++){

if(arr[j+1]>arr[j]){

temp = arr[j];

arr[j] = arr[j+1];

arr[j+1] = temp;

}

}

}

cout<<”Array in descending order”;

for(i=0;i<size;i++){

cout<<arr[i]<<"\n";

}

getch();

return 0;

}

Mar 09, 2010 | Compilers & Programming Tools

create form1 with one list box and form2 with text boxes and command button.

Go to project >project properties>start object will be form2..

Here i takenexamble of two textboxes..code is below

Private Sub Command1_Click()

Form1.List1.AddItem Text1.Text, 0

Form1.List1.AddItem Text2.Text, 1

Form1.Show

End Sub

hope this will help you...Thank you,....

Go to project >project properties>start object will be form2..

Here i takenexamble of two textboxes..code is below

Private Sub Command1_Click()

Form1.List1.AddItem Text1.Text, 0

Form1.List1.AddItem Text2.Text, 1

Form1.Show

End Sub

hope this will help you...Thank you,....

Nov 11, 2009 | Microsoft Visual Basic Professional...

As I see Totalcad 2D-3D is a little old program. Try to use compatibility mode for setup.exe

Also i give you a link to be more clear with that program. There you'll se on which OS is shoul work.

Also i give you a link to be more clear with that program. There you'll se on which OS is shoul work.

Aug 05, 2009 | Compilers & Programming Tools

If u use arrays and/or stacks make sure u access and write properly

Jun 19, 2009 | Compilers & Programming Tools

<!--StartFragment-->

Function InsertionSort(ByVal TempArray As Variant) As Variant

' Written By Louis Sutherland

' 1/25/99

' will be the sorted arrary when finishe

' d

Dim SortedList As Variant

Dim x, y As Integer

Dim NumSorted As Integer

'This Set up SortedList as an Array

SortedList = TempArray

'This zeroizes the new array

For x = 1 To UBound(SortedList)

SortedList(x) = 0

Next x

'sets the Total num counted to 1

NumSorted = 1

' Processes first element

SortedList(1) = TempArray(1)

For x = 2 To 5000

' insertion loop

For y = NumSorted To 1 Step -1

' if current value is <= then insert in

' next place

If TempArray(x) >= SortedList(y) Then

SortedList(y + 1) = TempArray(x)

'This Breaks the loop

y = 1

Exit For

Else

If y = 1 Then

SortedList(y + 1) = SortedList(y)

SortedList(y) = TempArray(x)

Exit For

Else

' save the value to the next spot

SortedList(y + 1) = SortedList(y)

End If

End If

Next y

'advance total num sorted

NumSorted = NumSorted + 1

Next x

InsertionSort = SortedList

End Function

Function InsertionSort(ByVal TempArray As Variant) As Variant

' Written By Louis Sutherland

' 1/25/99

' will be the sorted arrary when finishe

' d

Dim SortedList As Variant

Dim x, y As Integer

Dim NumSorted As Integer

'This Set up SortedList as an Array

SortedList = TempArray

'This zeroizes the new array

For x = 1 To UBound(SortedList)

SortedList(x) = 0

Next x

'sets the Total num counted to 1

NumSorted = 1

' Processes first element

SortedList(1) = TempArray(1)

For x = 2 To 5000

' insertion loop

For y = NumSorted To 1 Step -1

' if current value is <= then insert in

' next place

If TempArray(x) >= SortedList(y) Then

SortedList(y + 1) = TempArray(x)

'This Breaks the loop

y = 1

Exit For

Else

If y = 1 Then

SortedList(y + 1) = SortedList(y)

SortedList(y) = TempArray(x)

Exit For

Else

' save the value to the next spot

SortedList(y + 1) = SortedList(y)

End If

End If

Next y

'advance total num sorted

NumSorted = NumSorted + 1

Next x

InsertionSort = SortedList

End Function

Mar 17, 2009 | Microsoft Visual Basic 6.0 for PC

Haha, i wrote one of thee a while ago for a competition. You need to us e the char at function mate :D

Inside a for loop

Ill havea look for you though :D

Inside a for loop

Ill havea look for you though :D

Sep 09, 2008 | ArcMedia JavaScript Source Code 3000 Pro...

An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier

Initializing arrays. When declaring a regular array of local scope (within a function, for example), if we do not specify otherwise, its elements will not be initialized to any value by default, so their content will be undetermined until we store some value in them. The elements of global and static arrays, on the other hand, are automatically initialized with their default values, which for all fundamental types this means they are filled with zeros

include <iostream>

using namespace std;

int billy [] = {16, 2, 77, 40, 12071};

int n, result=0;

int main ()

{

for ( n=0 ; n<5 ; n++ )

{

result += billy[n];

}

cout << result;

return 0;

}

multidimensional array pseudo-multidimensional array #define WIDTH 5 #define HEIGHT 3 int jimmy [HEIGHT][WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { jimmy[n][m]=(n+1)*(m+1); } return 0; } #define WIDTH 5 #define HEIGHT 3 int jimmy [HEIGHT * WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { jimmy[n*WIDTH+m]=(n+1)*(m+1); } return 0; }

and now for trignometry

#include<iostream>

#include<cmath>

using namespace std;

int main()

{

int factorial(int);

int n = 3, i = 1;

double x, x2, b, PI, r;

char choice;

//r = x * (PI / 180)

cout<<"Please enter an angle value => ";

cin>>x;

cout<<"Is the angle value in Degree or Radian?"<<endl;

cout<<"Type D if its in degree "<<endl;

cout<<"Type R if its in radian "<<endl;

cin>>choice;

if((choice = 'R')||(choice = 'r'))

do{

i++; n = 3; x2 = 0; b = x2;

{

if(i == 1)

x2 = x - (pow(x,n) /factorial(n));

n = n + 2;

};

else

{

x2 = (x2 + ((pow(x,n)) /(factorial(n))) - (pow(x,n+2)) / (factorial(n+2)));

n = n + 4;

}

}while(abs(b - x2) > 0.000001);

else

//convert it to r

r = x * PI /180;

//cout<<"error occured/n";

cout<<"sin(x) = "<<x2<<endl;

return 0;

}

Initializing arrays. When declaring a regular array of local scope (within a function, for example), if we do not specify otherwise, its elements will not be initialized to any value by default, so their content will be undetermined until we store some value in them. The elements of global and static arrays, on the other hand, are automatically initialized with their default values, which for all fundamental types this means they are filled with zeros

include <iostream>

using namespace std;

int billy [] = {16, 2, 77, 40, 12071};

int n, result=0;

int main ()

{

for ( n=0 ; n<5 ; n++ )

{

result += billy[n];

}

cout << result;

return 0;

}

multidimensional array pseudo-multidimensional array #define WIDTH 5 #define HEIGHT 3 int jimmy [HEIGHT][WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { jimmy[n][m]=(n+1)*(m+1); } return 0; } #define WIDTH 5 #define HEIGHT 3 int jimmy [HEIGHT * WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { jimmy[n*WIDTH+m]=(n+1)*(m+1); } return 0; }

and now for trignometry

#include<iostream>

#include<cmath>

using namespace std;

int main()

{

int factorial(int);

int n = 3, i = 1;

double x, x2, b, PI, r;

char choice;

//r = x * (PI / 180)

cout<<"Please enter an angle value => ";

cin>>x;

cout<<"Is the angle value in Degree or Radian?"<<endl;

cout<<"Type D if its in degree "<<endl;

cout<<"Type R if its in radian "<<endl;

cin>>choice;

if((choice = 'R')||(choice = 'r'))

do{

i++; n = 3; x2 = 0; b = x2;

{

if(i == 1)

x2 = x - (pow(x,n) /factorial(n));

n = n + 2;

};

else

{

x2 = (x2 + ((pow(x,n)) /(factorial(n))) - (pow(x,n+2)) / (factorial(n+2)));

n = n + 4;

}

}while(abs(b - x2) > 0.000001);

else

//convert it to r

r = x * PI /180;

//cout<<"error occured/n";

cout<<"sin(x) = "<<x2<<endl;

return 0;

}

Mar 24, 2008 | ArcMedia JavaScript Source Code 3000 Pro...

Oct 06, 2016 | The PHP Group PHP

3,108 people viewed this question

Usually answered in minutes!

×