Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 40
» Latest member: akhin57
» Forum threads: 20
» Forum posts: 20

Full Statistics

Online Users
There are currently 5 online users.
» 0 Member(s) | 5 Guest(s)

Latest Threads
C++ - 35 - Rand & Srand ...
Forum: C++ - 35 - Rand & Srand ( Myanmar)
Last Post: Min Lwin
11-30-2017, 02:13 PM
» Replies: 0
» Views: 12
C++ - 34 - Functions - Pa...
Forum: C++ - 34 - Functions - Parameter ( Myanmar )
Last Post: Min Lwin
09-18-2017, 10:02 AM
» Replies: 0
» Views: 17
C++ - 33 - Functions - Re...
Forum: C++ - 33 - Functions - Returning Value ( Myanmar )
Last Post: Min Lwin
09-10-2017, 11:51 AM
» Replies: 0
» Views: 21
C++ - 32 - Functions ( ...
Forum: C++ - 32 - Functions ( Myanmar )
Last Post: Min Lwin
09-09-2017, 12:14 PM
» Replies: 0
» Views: 27
C++ - 31 - Multidimension...
Forum: C++ - 31 - Multidimension Array ( Myanmar )
Last Post: Min Lwin
09-06-2017, 10:02 AM
» Replies: 0
» Views: 35
C++ - 30 - Array Exercise...
Forum: C++ Exercise - 30 - Array Exercise - Respones( Myanmar )
Last Post: Min Lwin
09-05-2017, 09:37 AM
» Replies: 0
» Views: 13
C++ - 29 - Array Exercise...
Forum: C++ - 29 - Array Exercise ( Myanmar )
Last Post: Min Lwin
08-27-2017, 08:52 AM
» Replies: 0
» Views: 18
C++ - 28 - Array - 2 ( M...
Forum: C++ - 28 - Array - 2 ( Myanmar )
Last Post: Min Lwin
08-26-2017, 11:16 AM
» Replies: 0
» Views: 4
C++ - 27 - Array ( Codes ...
Forum: C++ - 27 - Array ( Myanmar )
Last Post: Min Lwin
08-24-2017, 12:16 PM
» Replies: 0
» Views: 11
C++ Exercise - 2 - Binomi...
Forum: C++ (or) C Exercise - 2 - X = ?
Last Post: Min Lwin
08-23-2017, 10:35 AM
» Replies: 0
» Views: 29

 
  C++ - 35 - Rand & Srand ( Myanmar)
Posted by: Min Lwin - 11-30-2017, 02:13 PM - Forum: C++ - 35 - Rand & Srand ( Myanmar) - No Replies

Code:
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
///00:00 hours, Jan 1, 1970 UTC
///rand Max Range : 32767
int main()
{
   time_t t;
   srand((unsigned)time(NULL));

   //cout << (unsigned)time(&t) << endl;
   for(int i = 0; i<20;i++)
       cout << rand() << " " ;

   return 0;
}

Print this item

  C++ - 34 - Functions - Parameter ( Codes )
Posted by: Min Lwin - 09-18-2017, 10:02 AM - Forum: C++ - 34 - Functions - Parameter ( Myanmar ) - No Replies

Code:
#include <iostream>

using namespace std;
int power(int base, int power);
int main()
{
   //int res = power();
   int ba, po;
   cin >> ba;
   cin >> po;
   cout << "The return value is : " << power(ba, po) <<endl;
   return 0;
}

int power(int base, int power){
   int result = 1;
   for(int i=1;i<=power;i++){
       result*=base;
   }
   return result;
}

Print this item

  C++ - 33 - Functions - Returning Value ( Codes )
Posted by: Min Lwin - 09-10-2017, 11:51 AM - Forum: C++ - 33 - Functions - Returning Value ( Myanmar ) - No Replies

Code:
#include <iostream>

using namespace std;
int power();
int main()
{
   int res = power();
   cout << "The return value is : " << power() <<endl;
   return 0;
}

int power(){
   int base = 3, power=2,result = 1;
   for(int i=1;i<=power;i++){
       result*=base;
   }
   return result;///16
}

Print this item

  C++ - 32 - Functions ( Codes )
Posted by: Min Lwin - 09-09-2017, 12:14 PM - Forum: C++ - 32 - Functions ( Myanmar ) - No Replies

Code:
#include <iostream>

using namespace std;
void power();
int main()
{
   power();

   return 0;
}

void power(){

   int base = 4, power=10,result=1;
   for(int i=1;i<=power;i++)
       result *= base;
   cout << "The result is : " << result <<endl;
}

Print this item

  C++ - 31 - Multidimension Array ( Code )
Posted by: Min Lwin - 09-06-2017, 10:02 AM - Forum: C++ - 31 - Multidimension Array ( Myanmar ) - No Replies

Code:
#include <iostream>

using namespace std;

int main()
{               /// Maths   Phy     Bio
               /// 0       1       2

///std1=>0     /// 80      90      100 ==> row
///std2=>1     /// 70      75      95  ==> row

   int normalarray[3] = {80, 90, 100}; ///=> Std1 3 exam result
   int mdarray[][3] = {{80, 90, 100},
                       {70, 75, 95}};

   for(int i=0; i<2;i++){
       for(int j=0; j<3;j++){
           cout << mdarray[i][j] << "\t";
       }
       cout << "\n" ;
   }
   return 0;
}

Print this item

  C++ - 30 - Array Exercise - Respones(Code)
Posted by: Min Lwin - 09-05-2017, 09:37 AM - Forum: C++ Exercise - 30 - Array Exercise - Respones( Myanmar ) - No Replies

Code:
#include <iostream>
#define SIZE 10
#include <iomanip>

using namespace std;

int main()
{
   int result[SIZE] = {0};
   int resp[] = {1, 2, 6, 4, 8, 5, 9, 7, 8, 10, 1,
                 6, 3, 8, 6, 10, 3, 8, 2, 7, 6, 5,
                 7, 6, 8, 6, 7, 5, 6, 6, 5, 6, 7,
                 5, 6, 4, 8, 6, 8, 10};
   int n = sizeof(resp) / sizeof(int);
   for(int i = 0; i<n;i++){
       ++result[resp[i]-1];
   }
   cout << setw(5) << "No" << setw(20) << "Amount      " << "Stars\n" <<endl;
   for(int i = 0; i < 10; i++){
       cout << setw(5) << i+1 << setw(14) << result[i] << "      ";
       for(int j = 0;j<result[i];j++){
           cout << "*";
       }
       cout << "\n";
   }


   return 0;
}













/*
1, 2, 6, 4, 8, 5, 9, 7, 8, 10, 1,
6, 3, 8, 6, 10, 3, 8, 2, 7, 6, 5,
7, 6, 8, 6, 7, 5, 6, 6, 5, 6, 7,
5, 6, 4, 8, 6, 8, 10
*/

Print this item

  C++ - 29 - Array Exercise ( Codes )
Posted by: Min Lwin - 08-27-2017, 08:52 AM - Forum: C++ - 29 - Array Exercise ( Myanmar ) - No Replies

Code:
#include <iostream>

using namespace std;

int main()
{
   int num[5], i=0 , n, big;
   while(i<5){
       cin >> n;
       if(n%2 == 0){
           num[i] = n;
           i++;
       }
   }
   for(i=0; i<5;i++){
       cout << num[i] << "\t";
   }
   cout << "\n\n";
   big = num[0];
   for(i=1;i<5;i++){
       if(num[i]>big){
           big = num[i];
       }
   }
   cout << "The biggest number : " << big << endl;
   return 0;
}

Print this item

  C++ - 28 - Array - 2 ( Myanmar - ျမန္မာ )
Posted by: Min Lwin - 08-26-2017, 11:16 AM - Forum: C++ - 28 - Array - 2 ( Myanmar ) - No Replies

Code:
#include <iostream>
#define SIZE 5
using namespace std;

int main()
{
   int num[SIZE];
   int n = sizeof(num)/sizeof(int);
   int i;
   for(i=0;i<SIZE;i++){
       num[i] = i+1;
       cout << num[i]<< endl;
   }
   return 0;
}

Print this item

  C++ - 27 - Array ( Codes )
Posted by: Min Lwin - 08-24-2017, 12:16 PM - Forum: C++ - 27 - Array ( Myanmar ) - No Replies

Code:
#include <iostream>

using namespace std;

int main()
{
   int num[5] = {1,2,3,4,5};

   for(int i=0; i<5;i++)
       cout << num[i]<< endl;
   return 0;
}

Print this item

  C++ Exercise - 2 - Binomial ( Codes )
Posted by: Min Lwin - 08-23-2017, 10:35 AM - Forum: C++ (or) C Exercise - 2 - X = ? - No Replies

Code:
#include <iostream>
#include <cmath>


using namespace std;

int main()
{
   double a , b , c, d, x1, x2;
   cout << "ax^2 + bx + c\n\n";
   cout << "Enter a : ";
   cin >> a;
   cout << "Enter b : ";
   cin >> b;
   cout << "Enter c : ";
   cin >> c;
   d = (b*b) - (4*a*c);
   d = sqrtf(d);
   if(d<0){
       cout << "There is no root\n";
   }else if (d>0){
       x1 = (- b + d) / (2*a);
       x2 = (- b - d) / (2*a);
       cout << "\n\nX1 : " << x1 << "\nX2 : " << x2 << endl;
   }else{
       x1 = -b / (2*a);
       cout << "There is only one x : " << x1 << endl;
   }
   return 0;
}



Attached Files
.pdf   Binomial.pdf (Size: 405.01 KB / Downloads: 0)
Print this item