1. Duplicate the even numbers. -1
Sample I/O
Array1:- 4,2,24,3,22
Updated Array:- 4,4,2,2,24,24,3,22,22
2. Reverse the array in a region - 1
Sample I/O
Array1:- 4,2,24,3,22,41,21
Enter Region:- 2,5
Update Array:-4,41,22,3,24,2,21
3. Store first the even digits in an array and then odd
digits in same array -2
Sample I/O
Array1:- 4,2,24,3,22,41,21
Array 2:- 4,2,2,4,2,2,4,2,3,1,1
4. Store the count of the digits in all numbers in an array
and print the count. -2
Sample I/O
Array1:- 4,2,9,3,7,41,28
Array 2:- 0,1,1,1,2,0,0,1,1,1
1-1;2-1;3-1;4-2;7-1;8-1;9-1
5. Store all palindrome numbers in to another array -2
Sample I/O
Array1:- 4,22,9,313,7,141,28
Array 2:- 4,22,9,313,141
6. Arrange the array in such a way that odd numbers come
first and then even numbers -1
Sample I/O
Array1:- 4,22,9,313,7,141,28
Update Array1:- 9,313,7,141,4,22,28
7. Store into another array by inserting it in the right
place - 2
Sample I/O
Array1:- 4,22,9,313,7,141,28
Array2:- 4 /4,22 /4,9,22 /4,9,22 ,313 /4,7,9,22 ,313
/4,7,9,22 ,141,313 /
4,7,9,22,28 ,141,313
8. Merge two sorted arrays in a sorted fashion - 3
Sample I/O
Array 1:- 3,6,7,9,11,16
Array 2:- 1,2,5,7,20
Array 3:- 1,2,3,5,6,7,9,11,16,20
9. Upadte the array so that an array element is followed by
its revere - 1
Sample I/O
Array 1:- 13,63,74,9,11,16
Updated Array 1:- 13,31,63,36,74,47,9,9,11,11,16,16
10.Spread the digits of the array in the same array. -1
Sample I/O
Array 1:- 13,63,74,9,11,16
Updated Array 1:-1,3,6,3,74,9,1,1,1,6
11.Shift the boundary of array to have only 2 digit numbers.
Sample I/O
Array 1:- 139,643,74,9,101,126
Updated Array 1:- 13,96,43,74,91,11,26
12.Print the largest occuring digit in an array of N numbers.
Sample I/O
Array 1:- 13,63,74,9,11,16
1 occurs most.
Answers were Sorted based on User's Feedback
1///Program to Duplicate the even numbers
#include<iostream>
using namespace std;
main()
{
int n,i,j;
cout<<"How many numbers do u want to enter:";
cin>>n;
int a[2*n];
if(n>0)
{
cout<<"Enter the numbers:";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"\n The original array is :";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
for(i=0;i<=n;i++)
{
if(a[i]%2==0)
{
n++;
for(j=n;j>i;j--)
{
a[j]=a[j-1];
}
i++;
a[i]=a[i-1];
}
}
cout<<"\n The updated array is:";
for(i=0;i<n-1;i++)
{
cout<<"\t"<<a[i];
}
}
else
cout<<"\n Invalid entry";
}
2.// Program to Reverse the array in the region
#include<iostream>
using namespace std;
main()
{
int n,i,x,y,t;
cout<<"How many numbers do u want to enter:";
cin>>n;
int a[n];
if(n>0)
{
cout<<"Enter the numbers:";
for(i=1;i<=n;i++)
cin>>a[i];
cout<<"Enter the positions for which the
array to be reversed from left to right:";
cin>>x>>y;
cout<<"\n the original array is:";
for(i=0;i<n;i++)
cout<<a[i];
if(x>y)
{
t=x;
x=y;
y=t;
}
if(x<1 || y>n)
cout<<"\n Invalid entry";
else
{
for(i=1;i<x;i++)
{
cout<<"\t"<<a[i];
}
for(i=y;i>=x;i--)
{
cout<<"\t"<<a[i];
}
for(i=y+1;i<=n;i++)
{
cout<<"\t"<<a[i];
}
}
}
else
cout<<"\n Invalid entry";
}
//Reverse the array in the region
#include<iostream>
using namespace std;
main()
{
int n,i,x,y,t;
cout<<"How many numbers do u want to enter:";
cin>>n;
int a[n];
if(n>0)
{
cout<<"Enter the numbers:";
for(i=1;i<=n;i++)
cin>>a[i];
cout<<"Enter the positions for which the
array to be reversed from left to right:";
cin>>x>>y;
cout<<"\n the original array is:";
for(i=0;i<n;i++)
cout<<a[i];
if(x>y)
{
t=x;
x=y;
y=t;
}
if(x<1 || y>n)
cout<<"\n Invalid entry";
else
{
for(i=1;i<x;i++)
{
cout<<"\t"<<a[i];
}
for(i=y;i>=x;i--)
{
cout<<"\t"<<a[i];
}
for(i=y+1;i<=n;i++)
{
cout<<"\t"<<a[i];
}
}
}
else
cout<<"\n Invalid entry";
}
3.//Store the count of the digits in all numbers in an array
and print the count
#include<iostream>
using namespace std;
main()
{
int
n,i,d,count0=0,count1=0,count2=0,count3=0,count4=0,count5=0,count6=0,count7=0,count8=0,count9=0;
cout<<"How many numbers do u want to enter:";
cin>>n;
int a[n];
int count[10];
if(n>0)
{
cout<<"\n Enter the numbers:\n";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"\n The original array is:";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
for(i=0;i<n;i++)
{
while(a[i]!=0)
{
d=a[i]%10;
if(d==0)
count0++;
if(d==1)
count1++;
if(d==2)
count2++;
if(d==3)
count3++;
if(d==4)
count4++;
if(d==5)
count5++;
if(d==6)
count6++;
if(d==7)
count7++;
if(d==8)
count8++;
if(d==9)
count9++;
a[i]=a[i]/10;
}
}
count[0]=count0;
count[1]=count1;
count[2]=count2;
count[3]=count3;
count[4]=count4;
count[5]=count5;
count[6]=count6;
count[7]=count7;
count[8]=count8;
count[9]=count9;
for(i=0;i<10;i++)
{
if(count[i]!=0)
cout<<"\n "<<i<<"-"<<count[i];
}
}
else
cout<<"\n Invalid entry";
}
4. ///Print the largest occuring digit in an array of n numbers
#include<iostream>
using namespace std;
main()
{
int
n,i,j,d,t,count0=0,count1=0,count2=0,count3=0,count4=0,count5=0,count6=0,count7=0,count8=0,count9=0;
cout<<"\n Enter the size of the array:";
cin>>n;
int a[n];
int b[10];
int e[10];
if(n>0)
{
cout<<"\n Enter the elements into the array:";
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
{
while(a[i]!=0)
{
d=a[i]%10;
if(d==0)
count0++;
if(d==1)
count1++;
if(d==2)
count2++;
if(d==3)
count3++;
if(d==4)
count4++;
if(d==5)
count5++;
if(d==6)
count6++;
if(d==7)
count7++;
if(d==8)
count8++;
if(d==9)
count9++;
a[i]=a[i]/10;
}
}
b[0]=count0;
b[1]=count1;
b[2]=count2;
b[3]=count3;
b[4]=count4;
b[5]=count5;
b[6]=count6;
b[7]=count7;
b[8]=count8;
b[9]=count9;
for(i=0;i<10;i++)
{
e[i]=b[i];
}
for(i=0;i<10;i++)
{
for(j=i;j<10;j++)
{
if(b[i]<b[j])
{
t=b[i];
b[i]=b[j];
b[j]=t;
}
}
}
for(i=0;i<10;i++)
{
if(e[i]==b[0])
cout<<"\n The largest occuring digit is:"<<i;
}
}
else
cout<<"\n Invalid entry";
}
5.//Arrange the array insuch a way that odd numbers come
first and then the even numbers
#include<iostream>
using namespace std;
main()
{
int n,i,j,t,k;
cout<<"\n Enter the size of the array:";
cin>>n;
int a[n];
if(n>0)
{
cout<<"\n Enter the elements into the array:";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"\n The original array is:";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
for(i=0;i<n;i++)
{
if(a[i]%2==0)
{
for(j=i+1;j<n;j++)
{
if(a[j]%2!=0)
{
t=a[j];
a[j]=a[i];
a[i]=t;
i++;
break;
}
for(k=i;k>0;k--)
{
a[k]=a[k-1];
}
}
}
}
cout<<"\n the updated array is:";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
}
else
cout<<"\n Invalid entry";
}
6.//Spread the digits of the array in the same array
#include<iostream>
using namespace std;
main()
{
int n,i,j;
cout<<"\n Enter the size of the array:";
cin>>n;
int a[n];
if(n>0)
{
cout<<"\n Enter the numbers into the array:";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"\n The original array is:";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
for(i=0;i<n;i++)
{
if(a[i]<0)
a[i]=a[i]*-1;
if(a[i]<10)
continue;
while(a[i]>9)
{
n++;
r=a[i]%10;
for(j=n-1;j>i;j--)
{
a[j]=a[j-1];
}
a[i+1]=r;
a[i]=a[i]/10;
}
}
cout<<"\n the updated array is:";
for(i=0;i<n;i++)
{
cout<<"\t"<<a[i];
}
}
else
cout<<"\n Invalid entry";
}
7.//Update the array so that an array element is followed by
its reverse
#include<iostream>
using namespace std;
main()
{
int n,i,p,rev,d,j;
cout<<"\n Enter the size of the array:";
cin>>n;
int a[2*n];
if(n>0)
{
cout<<"\n Enter the numbers into the array:";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"\n The original array is:";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
for(i=0;i<n;i++)
{
rev=0;
p=a[i];
while(p!=0)
{
d=p%10;
rev=(rev*10)+d;
p=p/10;
}
for(j=n;j>i;j--)
{
a[j]=a[j-1];
}
n++;
i++;
a[i]=rev;
}
cout<<"\n The updated array is:";
for(i=0;i<n;i++)
{
cout<<"\t"<<a[i];
}
}
else
cout<<"\n Invalid entry";
}
8.//Store all palindrome numbers into another array
#include<iostream>
using namespace std;
main()
{
int n,i,j,rev,r,num,m,count=0;
cout<<"How many numbers do u want to enter:";
cin>>n;
int a[n];
int b[n];
if(n>0)
{
cout<<"\n Enter the numbers:\n";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"\n The original array is:";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
cout<<"\n The updated array is:";
for(i=0;i<n;i++)
{
rev=0;
num=a[i];
while(a[i]!=0)
{
r=a[i]%10;
rev=(rev*10)+r;
a[i]=a[i]/10;
}
if(num==rev)
{
b[count]=num;
count++;
}
}
for(j=0;j<count;j++)
cout<<"\t"<<b[j];
}
else
cout<<"\n Invalid entry";
}
9.//Merge two stored array in a sorted fashion
#include<iostream>
using namespace std;
main()
{
int arr1[20],arr2[20],arr3[40],arr[40],temp;
int i,j,k,t;
int max1,max2;
cout<<"Enter number of elements in the list 1:";
cin>>max1;
cout<<"\n Take the elements in sorted order:\n";
for(i=0;i<max1;i++)
{
cout<<"Enter element"<<" "<<i+1<<":";
cin>>arr1[i];
}
cout<<"\n Enter number of elements in the list 2:";
cin>>max2;
cout<<"\n Take the elements in sorted order:\n";
for(j=0;j<max2;j++)
{
cout<<"Enter element"<<" "<<j+1<<":";
cin>>arr2[j];
}
i=0;
j=0;
k=0;
while((i<max1) && (j<max2))
{
if(arr1[i]<arr2[j])
arr3[k++]=arr1[i++];
else
arr3[k++]=arr2[j++];
}
while(i<max1)
arr3[k++]=arr1[i++];
while(j<max2)
arr3[k++]=arr2[j++];
cout<<"\n List 1:";
for(i=0;i<max1;i++)
cout<<"\t"<<arr1[i];
cout<<"\n List 2:";
for(j=0;j<max2;j++)
cout<<"\t"<<arr2[j];
cout<<"\n Merged list:";
for(k=0;k<(i+j);k++)
{
for(t=0;t<(i+j);t++)
{
if(arr3[k]<arr3[t])
{
temp=arr3[k];
arr3[k]=arr3[t];
arr3[t]=temp;
}
}
}
for(t=0;t<(i+j);t++)
{
if(arr3[t]!=arr3[t+1])
cout<<"\t"<<arr3[t];
}
cout<<"\n";
}
| Is This Answer Correct ? | 2 Yes | 0 No |
1///Program to Duplicate the even numbers
#include<iostream>
using namespace std;
main()
{
int n,i,j;
cout<<"How many numbers do u want to enter:";
cin>>n;
int a[2*n];
if(n>0)
{
cout<<"Enter the numbers:";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"\n The original array is :";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
for(i=0;i<=n;i++)
{
if(a[i]%2==0)
{
n++;
for(j=n;j>i;j--)
{
a[j]=a[j-1];
}
i++;
a[i]=a[i-1];
}
}
cout<<"\n The updated array is:";
for(i=0;i<n-1;i++)
{
cout<<"\t"<<a[i];
}
}
else
cout<<"\n Invalid entry";
}
2.// Program to Reverse the array in the region
#include<iostream>
using namespace std;
main()
{
int n,i,x,y,t;
cout<<"How many numbers do u want to enter:";
cin>>n;
int a[n];
if(n>0)
{
cout<<"Enter the numbers:";
for(i=1;i<=n;i++)
cin>>a[i];
cout<<"Enter the positions for which the
array to be reversed from left to right:";
cin>>x>>y;
cout<<"\n the original array is:";
for(i=0;i<n;i++)
cout<<a[i];
if(x>y)
{
t=x;
x=y;
y=t;
}
if(x<1 || y>n)
cout<<"\n Invalid entry";
else
{
for(i=1;i<x;i++)
{
cout<<"\t"<<a[i];
}
for(i=y;i>=x;i--)
{
cout<<"\t"<<a[i];
}
for(i=y+1;i<=n;i++)
{
cout<<"\t"<<a[i];
}
}
}
else
cout<<"\n Invalid entry";
}
//Reverse the array in the region
#include<iostream>
using namespace std;
main()
{
int n,i,x,y,t;
cout<<"How many numbers do u want to enter:";
cin>>n;
int a[n];
if(n>0)
{
cout<<"Enter the numbers:";
for(i=1;i<=n;i++)
cin>>a[i];
cout<<"Enter the positions for which the
array to be reversed from left to right:";
cin>>x>>y;
cout<<"\n the original array is:";
for(i=0;i<n;i++)
cout<<a[i];
if(x>y)
{
t=x;
x=y;
y=t;
}
if(x<1 || y>n)
cout<<"\n Invalid entry";
else
{
for(i=1;i<x;i++)
{
cout<<"\t"<<a[i];
}
for(i=y;i>=x;i--)
{
cout<<"\t"<<a[i];
}
for(i=y+1;i<=n;i++)
{
cout<<"\t"<<a[i];
}
}
}
else
cout<<"\n Invalid entry";
}
3.//Store the count of the digits in all numbers in an array
and print the count
#include<iostream>
using namespace std;
main()
{
int
n,i,d,count0=0,count1=0,count2=0,count3=0,count4=0,count5=0,count6=0,count7=0,count8=0,count9=0;
cout<<"How many numbers do u want to enter:";
cin>>n;
int a[n];
int count[10];
if(n>0)
{
cout<<"\n Enter the numbers:\n";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"\n The original array is:";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
for(i=0;i<n;i++)
{
while(a[i]!=0)
{
d=a[i]%10;
if(d==0)
count0++;
if(d==1)
count1++;
if(d==2)
count2++;
if(d==3)
count3++;
if(d==4)
count4++;
if(d==5)
count5++;
if(d==6)
count6++;
if(d==7)
count7++;
if(d==8)
count8++;
if(d==9)
count9++;
a[i]=a[i]/10;
}
}
count[0]=count0;
count[1]=count1;
count[2]=count2;
count[3]=count3;
count[4]=count4;
count[5]=count5;
count[6]=count6;
count[7]=count7;
count[8]=count8;
count[9]=count9;
for(i=0;i<10;i++)
{
if(count[i]!=0)
cout<<"\n "<<i<<"-"<<count[i];
}
}
else
cout<<"\n Invalid entry";
}
4. ///Print the largest occuring digit in an array of n numbers
#include<iostream>
using namespace std;
main()
{
int
n,i,j,d,t,count0=0,count1=0,count2=0,count3=0,count4=0,count5=0,count6=0,count7=0,count8=0,count9=0;
cout<<"\n Enter the size of the array:";
cin>>n;
int a[n];
int b[10];
int e[10];
if(n>0)
{
cout<<"\n Enter the elements into the array:";
for(i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
{
while(a[i]!=0)
{
d=a[i]%10;
if(d==0)
count0++;
if(d==1)
count1++;
if(d==2)
count2++;
if(d==3)
count3++;
if(d==4)
count4++;
if(d==5)
count5++;
if(d==6)
count6++;
if(d==7)
count7++;
if(d==8)
count8++;
if(d==9)
count9++;
a[i]=a[i]/10;
}
}
b[0]=count0;
b[1]=count1;
b[2]=count2;
b[3]=count3;
b[4]=count4;
b[5]=count5;
b[6]=count6;
b[7]=count7;
b[8]=count8;
b[9]=count9;
for(i=0;i<10;i++)
{
e[i]=b[i];
}
for(i=0;i<10;i++)
{
for(j=i;j<10;j++)
{
if(b[i]<b[j])
{
t=b[i];
b[i]=b[j];
b[j]=t;
}
}
}
for(i=0;i<10;i++)
{
if(e[i]==b[0])
cout<<"\n The largest occuring digit is:"<<i;
}
}
else
cout<<"\n Invalid entry";
}
5.//Arrange the array insuch a way that odd numbers come
first and then the even numbers
#include<iostream>
using namespace std;
main()
{
int n,i,j,t,k;
cout<<"\n Enter the size of the array:";
cin>>n;
int a[n];
if(n>0)
{
cout<<"\n Enter the elements into the array:";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"\n The original array is:";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
for(i=0;i<n;i++)
{
if(a[i]%2==0)
{
for(j=i+1;j<n;j++)
{
if(a[j]%2!=0)
{
t=a[j];
a[j]=a[i];
a[i]=t;
i++;
break;
}
for(k=i;k>0;k--)
{
a[k]=a[k-1];
}
}
}
}
cout<<"\n the updated array is:";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
}
else
cout<<"\n Invalid entry";
}
6.//Spread the digits of the array in the same array
#include<iostream>
using namespace std;
main()
{
int n,i,j;
cout<<"\n Enter the size of the array:";
cin>>n;
int a[n];
if(n>0)
{
cout<<"\n Enter the numbers into the array:";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"\n The original array is:";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
for(i=0;i<n;i++)
{
if(a[i]<0)
a[i]=a[i]*-1;
if(a[i]<10)
continue;
while(a[i]>9)
{
n++;
r=a[i]%10;
for(j=n-1;j>i;j--)
{
a[j]=a[j-1];
}
a[i+1]=r;
a[i]=a[i]/10;
}
}
cout<<"\n the updated array is:";
for(i=0;i<n;i++)
{
cout<<"\t"<<a[i];
}
}
else
cout<<"\n Invalid entry";
}
7.//Update the array so that an array element is followed by
its reverse
#include<iostream>
using namespace std;
main()
{
int n,i,p,rev,d,j;
cout<<"\n Enter the size of the array:";
cin>>n;
int a[2*n];
if(n>0)
{
cout<<"\n Enter the numbers into the array:";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"\n The original array is:";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
for(i=0;i<n;i++)
{
rev=0;
p=a[i];
while(p!=0)
{
d=p%10;
rev=(rev*10)+d;
p=p/10;
}
for(j=n;j>i;j--)
{
a[j]=a[j-1];
}
n++;
i++;
a[i]=rev;
}
cout<<"\n The updated array is:";
for(i=0;i<n;i++)
{
cout<<"\t"<<a[i];
}
}
else
cout<<"\n Invalid entry";
}
8.//Store all palindrome numbers into another array
#include<iostream>
using namespace std;
main()
{
int n,i,j,rev,r,num,m,count=0;
cout<<"How many numbers do u want to enter:";
cin>>n;
int a[n];
int b[n];
if(n>0)
{
cout<<"\n Enter the numbers:\n";
for(i=0;i<n;i++)
cin>>a[i];
cout<<"\n The original array is:";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
cout<<"\n The updated array is:";
for(i=0;i<n;i++)
{
rev=0;
num=a[i];
while(a[i]!=0)
{
r=a[i]%10;
rev=(rev*10)+r;
a[i]=a[i]/10;
}
if(num==rev)
{
b[count]=num;
count++;
}
}
for(j=0;j<count;j++)
cout<<"\t"<<b[j];
}
else
cout<<"\n Invalid entry";
}
9.//Merge two stored array in a sorted fashion
#include<iostream>
using namespace std;
main()
{
int arr1[20],arr2[20],arr3[40],arr[40],temp;
int i,j,k,t;
int max1,max2;
cout<<"Enter number of elements in the list 1:";
cin>>max1;
cout<<"\n Take the elements in sorted order:\n";
for(i=0;i<max1;i++)
{
cout<<"Enter element"<<" "<<i+1<<":";
cin>>arr1[i];
}
cout<<"\n Enter number of elements in the list 2:";
cin>>max2;
cout<<"\n Take the elements in sorted order:\n";
for(j=0;j<max2;j++)
{
cout<<"Enter element"<<" "<<j+1<<":";
cin>>arr2[j];
}
i=0;
j=0;
k=0;
while((i<max1) && (j<max2))
{
if(arr1[i]<arr2[j])
arr3[k++]=arr1[i++];
else
arr3[k++]=arr2[j++];
}
while(i<max1)
arr3[k++]=arr1[i++];
while(j<max2)
arr3[k++]=arr2[j++];
cout<<"\n List 1:";
for(i=0;i<max1;i++)
cout<<"\t"<<arr1[i];
cout<<"\n List 2:";
for(j=0;j<max2;j++)
cout<<"\t"<<arr2[j];
cout<<"\n Merged list:";
for(k=0;k<(i+j);k++)
{
for(t=0;t<(i+j);t++)
{
if(arr3[k]<arr3[t])
{
temp=arr3[k];
arr3[k]=arr3[t];
arr3[t]=temp;
}
}
}
for(t=0;t<(i+j);t++)
{
if(arr3[t]!=arr3[t+1])
cout<<"\t"<<arr3[t];
}
cout<<"\n";
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Explain what is the difference between a string and an array?
Explain goto?
struct abc { unsigned int a; char b; float r; }; struct xyz { int u; struct abc tt; }ww; ww = (struct xyz*)malloc(sizeof(struct xyz)); will the memory be allocated for the inner structure also?
What is the difference between the expression “++a” and “a++”?
Agonistic behavior, or aggression, is exhibited by most of the more than three million species of animals on this planet. Animal behaviorists still disagree on a comprehensive definition of the term, hut aggressive behavior can be loosely described as any action that harms an adversary or compels it to retreat. Aggression may serve many purposes, such as Food gathering, establishing territory, and enforcing social hierarchy. In a general Darwinian sense, however, the purpose of aggressive behavior is to increase the individual animal’s—and thus, the species’—chance of survival. Aggressive behavior may he directed at animals of other species, or it may be conspecific—that is, directed at members of an animal’s own species. One of the most common examples of conspecific aggression occurs in the establishment and maintenance of social hierarchies. In a hierarchy, social dominance is usually established according to physical superiority; the classic example is that of a pecking order among domestic fowl. The dominance hierarchy may be viewed as a means of social control that reduces the incidence of attack within a group. Once established, the hierarchy is rarely threatened by disputes because the inferior animal immediately submits when confronted by a superior. Two basic types of aggressive behavior are common to most species: attack and defensive threat. Each type involves a particular pattern of physiological and behavioral responses, which tends not to vary regardless of the stimulus that provokes it. For example, the pattern of attack behavior in cats involves a series of movements, such as stalking, biting, seizing with the forepaws and scratching with tile hind legs, that changes very little regardless of the stimulus—that is, regardless of who or what the cat is attacking. The cat’s defensive threat response offers another set of closely linked physiological and behavioral patterns. The cardiovascular system begins to pump blood at a faster rate, in preparation for sudden physical activity. The eves narrow and the ears flatten against the side of the cat’s head for protection, and other vulnerable areas of the body such as the stomach and throat are similarly contracted. Growling or hissing noises and erect fur also signal defensive threat. As with the attack response, this pattern of responses is generated with little variation regardless of the nature of the stimulus. Are these aggressive patterns of attack and defensive threat innate, genetically programmed, or are they learned? The answer seems to be a combination of both. A mouse is helpless at birth, but by its l2th day of life can assume a defensive threat position by backing up on its hind legs. By the time it is one month old, the mouse begins to exhibit the attack response. Nonetheless, copious evidence suggests that animals learn and practice aggressive behavior; one need look no further than the sight of a kitten playing with a ball of string. All the elements of attack—stalking, pouncing, biting, and shaking—are part of the game that prepares the kitten for more serious situations later in life. 7) The passage asserts that animal social hierarchies are generally stable because: a) the behavior responses of the group are known by all its members. b) the defensive threat posture quickly stops most conflicts. c) inferior animals usually defer to their physical superior. d) the need for mutual protection from other species inhibits conspecific aggression. 8) According to the author, what is the most significant physiological change undergone by a cat assuming the defensive threat position? a) An increase in cardiovascular activity b) A sudden narrowing of the eyes c) A contraction of the abdominal muscles d) The author does not say which change is most significant 9) Based on the information in the passage about agonistic behavior, it is reasonable to conclude that: I. the purpose of agonistic behavior is to help ensure the survival of the species. II. agonistic behavior is both innate and learned. III. conspecific aggression is more frequent than i aggression. a) I only b) II only c) I and II only d) I,II and III only 10) Which of the following would be most in accord with the information presented in the passage? a) The aggressive behavior of sharks is closely inked to their need to remain in constant motion. b) fine inability of newborn mice to exhibit the attack response proves that aggressive behavior must be learned. c) Most animal species that do riot exhibit aggressive behavior are prevented from doing so by environmental factors. d) Members of a certain species of hawk use the same method to prey on both squirrels and gophers. 11) The author suggests that the question of whether agonistic behavior is genetically programmed or learned: a) still generates considerable controversy among animal behaviorists. b) was first investigated through experiments on mice. c) is outdated since most scientists now believe the genetic element to be most important. d) has been the subject of extensive clinical study. 12) Which of the following topics related to agonistic behavior is NOT explicitly addressed in the passage? a) The physiological changes that accompany attack behavior in cats b) The evolutionary purpose of aggression c) Conspecific aggression that occurs in dominance hierarchies d) The relationship between play and aggression 13) The author of this passage is primarily concerned with: a) analyzing the differences between attack behavior and defensive threat behavior. b) introducing a subject currently debated among animal behaviorists. c) providing a general overview of aggressive behavior in animals. d) illustrating various manifestations of agonistic behavior among mammals.
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.
What is the use of linkage in c language?
How is = symbol different from == symbol in c programming?
what is a pointer
4 Answers Bank Of America, TCS,
Eight queens puzzle
write a program that explain #define and # undef directive
Is there any possibility to create customized header file with c programming language?