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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 32
» Latest member: Mi Pwint
» Forum threads: 10
» Forum posts: 10

Full Statistics

Online Users
There is currently 1 user online
» 0 Member(s) | 1 Guest(s)

Latest Threads
C++ - 26 - Switch ( Codes...
Forum: C++ - 26 - Switch ( Myanmar )
Last Post: Min Lwin
08-19-2017, 11:24 AM
» Replies: 0
» Views: 8
C++ - 25 - Do While Loop ...
Forum: C++ - 25 - Do While Loop ( Myanmar )
Last Post: Min Lwin
08-14-2017, 06:38 AM
» Replies: 0
» Views: 17
C++ - 24 - While ( Codes ...
Forum: C++ - 24 - While ( Myanmar )
Last Post: Min Lwin
08-12-2017, 08:27 AM
» Replies: 0
» Views: 16
C++ - 23 - For Loop Exerc...
Forum: C++ - 23 - For Loop Exercise ( Myanmar )
Last Post: Min Lwin
08-11-2017, 05:11 PM
» Replies: 0
» Views: 21
C++ - 22 - For Loop ( Cod...
Forum: C++ - 22 - For Loop ( Myanmar )
Last Post: Min Lwin
08-10-2017, 08:08 AM
» Replies: 0
» Views: 16
C++ Exercises - 1 - Air T...
Forum: C++ Exercises - 1 - Air Ticket
Last Post: Min Lwin
08-09-2017, 08:57 AM
» Replies: 0
» Views: 17
C++ - 21 - Increment & D...
Forum: C++ - 21 - Increment & Decrement ( Myanmar )
Last Post: Min Lwin
08-09-2017, 06:23 AM
» Replies: 0
» Views: 23
Air_Ticket (Source Code)
Forum: C++ Exercises - 1 - Air Ticket
Last Post: blackcoder
08-06-2017, 03:26 PM
» Replies: 0
» Views: 21
C++ - Exercise-1- Air Tic...
Forum: C++ Exercises - 1 - Air Ticket
Last Post: Min Lwin
08-06-2017, 08:09 AM
» Replies: 0
» Views: 93
C Programming that can fi...
Forum: C Programming Exercise - 1
Last Post: Heinthu ya
07-15-2017, 06:37 PM
» Replies: 0
» Views: 42

 
  C++ - 26 - Switch ( Codes )
Posted by: Min Lwin - 08-19-2017, 11:24 AM - Forum: C++ - 26 - Switch ( Myanmar ) - No Replies

Code:
#include <iostream>

using namespace std;

int main()
{
   int num;
   cin >> num;
   switch(num){
   case 1:
       cout << "This is case 1";
       break;
   case 2:
       cout << "This is case 2";
       break;
   case 3:
       cout << "This is case 3";
       break;
   case 0:
       cout << "Exit";
       break;
   default:
       cout << "Wrong Input";

   }
   return 0;
}

Print this item

  C++ - 25 - Do While Loop ( Codes )
Posted by: Min Lwin - 08-14-2017, 06:38 AM - Forum: C++ - 25 - Do While Loop ( Myanmar ) - No Replies

Code:
#include <iostream>

using namespace std;

int main()
{
   int num = 5;
   do{
       ///true_code
       cout << num << endl;
       num--;
   }while(num > 5);
   cout << num;
   return 0;
}

Print this item

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

Code:
#include <iostream>

using namespace std;

int main()
{   /*int i = 3;
   while(i>=0){
       ///true-code
       cout << "Hello\n";
       --i;
   }
   cout << i << endl;
   cout << "Done\n";
   */
   int i = 1, total = 0;
   while(i<=100){
       total += i;
       i++;
   }
   cout << total;
   return 0;
}

Print this item

  C++ - 23 - For Loop Exercise ( Code )
Posted by: Min Lwin - 08-11-2017, 05:11 PM - Forum: C++ - 23 - For Loop Exercise ( Myanmar ) - No Replies

Code:
#include <iostream>

using namespace std;

int main()
{
   ///1! = 1
   ///2! = 1 * 2
   ///3! = 1 * 2 * 3
   int i, f = 1,num1;
   cout << "Enter a Number : ";
   cin >> num1;
   if(num1 == 0){
       cout << "0!\t : " << f << endl;
   }else{
       for(i=1; i <= num1; i++ ){
       f *= i;
       cout << i << "!\t : " << f << endl;
       }
   }

   return 0;
}

Print this item

  C++ - 22 - For Loop ( Code )
Posted by: Min Lwin - 08-10-2017, 08:08 AM - Forum: C++ - 22 - For Loop ( Myanmar ) - No Replies

Code:
#include <iostream>

using namespace std;

int main()
{
   ///For loop
   /*
   for(start, end, condition){

   ///true code
   }
   */
   int i;
   char name[] = "Your Name";
   for(i=0; name[i] != '\0';i++){
       cout << name[i];
   }
   cout << "\nDone";
   //cout << i;






   return 0;
}

Print this item

  C++ Exercises - 1 - Air Ticket (By ၿငိမ္းၿငိမ္း ျမတ္)
Posted by: Min Lwin - 08-09-2017, 08:57 AM - Forum: C++ Exercises - 1 - Air Ticket - No Replies

Code:
#include<iostream>
using namespace std;
int main()
{
   int n,i,p,b,c;
   char ch,chr;
   p=0;
   c=0;
   cout <<"enter your desire number of tickets";
   cin>>n;
   for(i=0;i<n;i++)
   {
       cout<<"enter time morning 'm' or afternoon 'a' night'N'";
       cin>>ch;
       cout<<"enter class 'e' or 'f'";
       cin>>chr;
       if(ch=='m' && chr=='e')
           p=100;
       else if (ch=='m' && chr=='f')
           p=150;
       else if(ch=='a' && chr=='e')
           p=90;
       else if(ch=='a' && chr=='f')
           p=140;
       else if(ch=='N' && chr=='e')
           p=70;
       else p=120;
           c=c+p;
   }
   if(n>2)
   {
       b=(c/100)*15;
       c=c-b;
   }
   cout<<"cost is. "<<c;
   return 0;
   }

Print this item

  C++ - 21 - Increment & Decrement ( Myanmar - ျမန္မာ )
Posted by: Min Lwin - 08-09-2017, 06:23 AM - Forum: C++ - 21 - Increment & Decrement ( Myanmar ) - No Replies

Code:
#include <iostream>

using namespace std;

int main()
{
   ///++
   ///--
   int num1 = 5;
   //cout << num1<< endl;
   //cout << num1++<<endl;
   ///num1+=1;
   //cout << num1<< endl;
   ///num1+=1;
   //cout << ++num1<< endl;
   cout << num1<< endl;
   cout << num1--<< endl;
   cout << num1<< endl;
   cout << --num1<< endl;
   return 0;
}

Print this item

  Air_Ticket (Source Code)
Posted by: blackcoder - 08-06-2017, 03:26 PM - Forum: C++ Exercises - 1 - Air Ticket - No Replies

https://my.pcloud.com/publink/show?code=...K6oXqVHUjk

Print this item

Information C++ - Exercise-1- Air Ticket (By ProgrammingMM)
Posted by: Min Lwin - 08-06-2017, 08:09 AM - Forum: C++ Exercises - 1 - Air Ticket - No Replies

Code:
#include <iostream>

using namespace std;

int main()
{
   int time, cls, c, price = 0, disprice = 0;
   cout << "\t\tTime\n\n";
   cout << "1-Morning\n";
   cout << "2-Afternoon\n";
   cout << "3-Night\n\n: ";
   cin >> time;
   cout << "\n\t\tClasses\n\n";
   cout << "1-Eco\n";
   cout << "2-First\n\n: ";
   cin >> cls;
   cout << "\nHow many Ticket do you want?\n: ";
   cin >> c;

   if(time == 1){
           if(cls == 1){
              price  +=  100 * c;  /// price = price +  (100 * c);
           }else if(cls == 2){
               price  +=  150 * c;
           }
           

   }else if(time == 2){
           if(cls == 1){
               price  +=  90 * c;
           }else if(cls == 2){
               price  +=  140 * c;
           }
   }else if(time == 3){
           if(cls == 1){
               price  +=  70 * c;
           }else if(cls == 2){
               price  +=  120 * c;
           }
   }else{
       cout << "Wrong Input";
   }
   
   if(c >2 && time < 4){
       disprice = price * 0.85; /// price - (price * 0.15);
       cout << "The actual Price : $" << price << endl;
       cout << "Discount Price : $" << disprice <<endl;
   }else if(time < 4){
       cout << "The total price : $" << price << endl;
   }

   return 0;
}



Attached Files
.pdf   Air Ticket.pdf (Size: 488.81 KB / Downloads: 3)
Print this item

Lightbulb C Programming that can find Determinant of 3 x 3 Matrix
Posted by: Heinthu ya - 07-15-2017, 06:37 PM - Forum: C Programming Exercise - 1 - No Replies

 #include<stdio.h>

int main(){

int a[3][3],i,j;

long determinant;

printf("Enter the 9 elements of matrix: ");
for(i=0;i<3;i++)
for(j=0;j<3;j++)
scanf("%d",&a[i][j]);

printf("\nThe matrix is\n");
for(i=0;i<3;i++){
printf("\n");
for(j=0;j<3;j++)
printf("%d\t",a[i][j]);
}

determinant = a[0][0]*((a[1][1]*a[2][2]) - (a[2][1]*a[1][2])) -a[0][1]*(a[1][0]*a[2][2] - a[2][0]*a[1][2]) + a[0][2]*(a[1][0]*a[2][1] - a[2][0]*a[1][1]);

printf("\nDeterminant of 3X3 matrix: %ld",determinant);

return 0;
}

Sample output:
Enter the 9 elements of matrix: 1
2
3
4
5
6
7
8
9

The matrix is

1 2 3
4 5 6
7 8 9

Determinant of 3X3 matrix: 0

Print this item