C/C++ Help ..!!!

maxXxa

Member
Apr 14, 2010
341
5
0
ane mata prshna wagayak thiyenawa ... mata meloo magulak therenne naha ..meloo rahakuth na :(:(
plzzz ane mata ba kiyanna nathuwa udawwak denna .. oyalata godak pin
  • write a main method of a C++ program to accept 4 integers & prints the message "ascending" if the numbers are in increasing order.(use conditional operator).
  • given 3 numbers a,b,c write the main method to print their values in descending order.For example a=10,b=11,c=6 your program should print;

    Highest number=11
    Next highest number = 10
    Smallest number = 6
  • write a function that reads a 3-digit number from input and prints 'yes' if the individual digita are in increasing OR decreasing order.
    ex: 123
    yes

    654
    yes

    154
    no
  • write a C program to input a series of temperatures terminated by -999.Find the minimum,maximum and the average of the list of temperatures.

anee udaw karanna .... :(:(:(:(
 

maxXxa

Member
Apr 14, 2010
341
5
0
anee plzz udaw karanna.. mata prashna tikak thiyenawa :(:( kohoma kalath therenne naha :(

  • define 2 functions which, respectively store input values of the elements of an array of reals and output the square of array elements.
void ReadArray(double nums[], const int size);
void WriteArray(double nums[], const int size);
  • Write C++ program to define 3 functions calMode,calMean and calMedian to output mode, mean and median of a fixed size integer array.Function prototypes are as follows(hint:assume that array size is 3)
void calMode(int num[size]);
void calMean(int num[size]);
void calMedian(int num[size]);

  • Write the main method to print the elements of the following array using a pointer.

double rates[]= {2.4,5.7,4.6};

  • Define 2 functions which, respectively find the maximum of the elements of an array of integers and other finds the minimum of the array elements:

double findMax(double nums[], const int size);
double findMin(double nums[], const int size);

  • Write a syntax to declare and initialize an integer pointer.
 
Last edited:

maxXxa

Member
Apr 14, 2010
341
5
0
me array eke thiyena elements pointer ekak use karala print karaganne kohomada..?? :(

double rates[]= {2.4,5.7,4.6};
 

Nisala88

Well-known member
  • Oct 24, 2006
    4,206
    735
    113
    ~Madhouse~
    ane mata prshna wagayak thiyenawa ... mata meloo magulak therenne naha ..meloo rahakuth na :(:(
    plzzz ane mata ba kiyanna nathuwa udawwak denna .. oyalata godak pin
    • write a main method of a C++ program to accept 4 integers & prints the message "ascending" if the numbers are in increasing order.(use conditional operator).

      #include<iostream.h>
      #include<iomanip>

      using namespace std;

      int main()
      {
      int *array,num;

      cout<<"How many integers do you want to allocate ?";
      cin>>num;

      array = new int[num+1];

      if (array==NULL)
      {
      cout<<"Error allocating memory!\n";
      return;
      }

      cout<<"Enter the integers:\n";

      for (int count =0; count < num; count++)
      {
      cout << "Integer # " << (count +1) << ": ";
      cin >> array[count];
      }

      machn hariyatama mathaka ne meka poddak check karapan, mam gawa compiler ekak ne

      ubata wedi wistara hoyaganna puluwan cplusplus.com eken, meka godak hoda site ekak
     

    maxXxa

    Member
    Apr 14, 2010
    341
    5
    0
    ane mata prshna wagayak thiyenawa ... mata meloo magulak therenne naha ..meloo rahakuth na :(:(
    plzzz ane mata ba kiyanna nathuwa udawwak denna .. oyalata godak pin
    • write a main method of a C++ program to accept 4 integers & prints the message "ascending" if the numbers are in increasing order.(use conditional operator).

      #include<iostream.h>
      #include<iomanip>

      using namespace std;

      int main()
      {
      int *array,num;

      cout<<"How many integers do you want to allocate ?";
      cin>>num;

      array = new int[num+1];

      if (array==NULL)
      {
      cout<<"Error allocating memory!\n";
      return;
      }

      cout<<"Enter the integers:\n";

      for (int count =0; count < num; count++)
      {
      cout << "Integer # " << (count +1) << ": ";
      cin >> array[count];
      }

      machn hariyatama mathaka ne meka poddak check karapan, mam gawa compiler ekak ne

      ubata wedi wistara hoyaganna puluwan cplusplus.com eken, meka godak hoda site ekak

    • thnxx bro.. :)
     

    speg

    Member
    Dec 13, 2007
    876
    110
    0
    gedhara ennada?
    ane mata prshna wagayak thiyenawa ... mata meloo magulak therenne naha ..meloo rahakuth na :(:(
    plzzz ane mata ba kiyanna nathuwa udawwak denna .. oyalata godak pin
    • write a main method of a C++ program to accept 4 integers & prints the message "ascending" if the numbers are in increasing order.(use conditional operator).
    • given 3 numbers a,b,c write the main method to print their values in descending order.For example a=10,b=11,c=6 your program should print;

      Highest number=11
      Next highest number = 10
      Smallest number = 6
    • write a function that reads a 3-digit number from input and prints 'yes' if the individual digita are in increasing OR decreasing order.
      ex: 123
      yes

      654
      yes

      154
      no
    • write a C program to input a series of temperatures terminated by -999.Find the minimum,maximum and the average of the list of temperatures.

    anee udaw karanna .... :(:(:(:(


    wadee harida?
     

    udithag

    Active member
  • Aug 29, 2007
    825
    46
    28
    machan thama ekak hambaune nadda? kawadatada oka denda one? matath dan hariyatama C++ mathaka na eth tikak try karala balanda puluwan
     

    speg

    Member
    Dec 13, 2007
    876
    110
    0
    gedhara ennada?
    ane mata prshna wagayak thiyenawa ... mata meloo magulak therenne naha ..meloo rahakuth na :(:(
    plzzz ane mata ba kiyanna nathuwa udawwak denna .. oyalata godak pin
    • write a main method of a C++ program to accept 4 integers & prints the message "ascending" if the numbers are in increasing order.(use conditional operator).

      #include<iostream.h>
      #include<iomanip>

      using namespace std;

      int main()
      {
      int *array,num;

      cout<<"How many integers do you want to allocate ?";
      cin>>num;

      array = new int[num+1];

      if (array==NULL)
      {
      cout<<"Error allocating memory!\n";
      return;
      }

      cout<<"Enter the integers:\n";

      for (int count =0; count < num; count++)
      {
      cout << "Integer # " << (count +1) << ": ";
      cin >> array[count];
      }

      machn hariyatama mathaka ne meka poddak check karapan, mam gawa compiler ekak ne

      ubata wedi wistara hoyaganna puluwan cplusplus.com eken, meka godak hoda site ekak


    • :oo::oo::oo::oo:
      mama nam hithanne meeka ubata wadiy kiyala hnd da karanne?
     

    maxXxa

    Member
    Apr 14, 2010
    341
    5
    0


    wadee harida?

    ela mchn ea tika nam hari... mea tika thama aula...:(:(:(
    anee plzz udaw karanna.. mata prashna tikak thiyenawa kohoma kalath therenne naha
    define 2 functions which, respectively store input values of the elements of an array of reals and output the square of array elements.
    void ReadArray(double nums[], const int size);
    void WriteArray(double nums[], const int size);

    Write C++ program to define 3 functions calMode,calMean and calMedian to output mode, mean and median of a fixed size integer array.Function prototypes are as follows(hint:assume that array size is 3)
    void calMode(int num[size]);
    void calMean(int num[size]);
    void calMedian(int num[size]);

    Write the main method to print the elements of the following array using a pointer.
    double rates[]= {2.4,5.7,4.6};

    Define 2 functions which, respectively find the maximum of the elements of an array of integers and other finds the minimum of the array elements:
    double findMax(double nums[], const int size);
    double findMin(double nums[], const int size);

    Write a syntax to declare and initialize an integer pointer.