SlideShare a Scribd company logo
1.



A=50 B=30 C=5 D=3 E = 10
1.1 (A+B)*(E-D)                       1.6 --D+C+B--
1.2 ++D+C*E                       1.7 25*D/5+10
1.3 (25+A)/C+B                        1.8 A+B--+D
1.4 A*=D                          1.9 C*2+E*5
1.5 20*C+B+++D/2                  1.10 (A*2)+B/C-
15



A=50 B=30 C=5 D=3 E = 10
     (A+B)*(E-D)
/*Program : variable1.cpp
Process : Display set value of varible */
#include <iostream.h>
#include <conio.h>
void main()
{    int A B,D,E,;
     A=50;
B=30;
    D=3;
    E=10;
    total1=(A+B);
    total2=(E-D);
    total=total1*total2;
    cout <<"Total = "<< total<<endl;
    getch();
}




A=50 B=30 C=5 D=3 E = 10
    ++D+C*E
/*Program : variable2.cpp
Process : Display set value of varible */
#include <iostream.h>
#include <conio.h>
void main()
{   int C,D,E;
C=5;
    D=3;
    E=10;
    total1=++D;
    total2=C*E;
    total=total1*total2;
    cout <<"Total = "<< total<<endl;
    getch();
}
A=50 B=30 C=5 D=3 E = 10
1.3   (25+A)/C+B
/*Program : variable3.cpp
Process : Display set value of varible */
#include <iostream.h>
#include <conio.h>
void main()
{     int A B,C;
      A=50;
      B=30;
      C=5;
      total1=(25+A);
      total2=total1/C;
      total=total2+B;
      cout <<"Total = "<< total<<endl;
      getch();
}
A=50 B=30 C=5 D=3 E = 10
14. A*=D
/*Program : variable4.cpp
Process : Display set value of varible */
#include <iostream.h>
#include <conio.h>
void main()
{   int A D;
    A=50;
    D=10;
    total=A*=D;
    cout <<"Total = "<<total<<endl;
    getch();
}
A=50 B=30 C=5 D=3 E = 10
1.5 20*C+B+++D/2
/*Program : variable5.cpp
Process : Display set value of varible */
#include <iostream.h>
#include <conio.h>
void main()
{   int A B,C;
    B=30;
    C=5;
    D=3;
    total1=B++;
    total2=20*C;
    total3=D/2;
    total4=total2+total1;
total=total4+total3;
    cout <<"Total = "<<total<<endl;
    getch();
}




A=50 B=30 C=5 D=3 E = 10
1.6 --D+C+B—
/*Program : variable6.cpp
Process : Display set value of varible */
#include <iostream.h>
#include <conio.h>
void main()
{   int B,C,D;
    B=30;
    C=5;
    D=3;
    total1=--D;
    total2=B--;
    total3=total1+C;
    total=total3+total2;
    cout <<"Total = "<<total<<endl;
    getch();
}
A=50 B=30 C=5 D=3 E = 10
1.7 25*D/5+10
/*Program : variable7.cpp
Process : Display set value of varible */
#include <iostream.h>
#include <conio.h>
void main()
{   int D;
    D=3;
    total1=25*D;
    total2=total1/5;
    total=total2+10;
    cout <<"Total = "<<total<<endl;
getch();
}




A=50 B=30 C=5 D=3 E = 10
1.8 A+B--+D
/*Program : variable8.cpp
Process : Display set value of varible */
#include <iostream.h>
#include <conio.h>
void main()
{   int A,B,D;
    A=50;
    B=30;
    D=3;
    total1=B--;
    total2=A+total1;
    total=total2+D;
    cout <<"Total = "<<total<<endl;
    getch();
}
A=50 B=30 C=5 D=3 E = 10
1.9 C*2+E*5
/*Program : variable9.cpp
Process : Display set value of varible */
#include <iostream.h>
#include <conio.h>
void main()
{   int C,E;
    C=5;
    E=10;
    total1=C*2;
total2=E*5;
    total=total1+total2;
    cout <<"Total = "<<total<<endl;
    getch();
}
A=50 B=30 C=5 D=3 E = 10
1.10 (A*2)+B/C-15
/*Program : variable10.cpp
Process : Display set value of varible */
#include <iostream.h>
#include <conio.h>
void main()
{   int A,B,C;
    A=50;
    B=30;
    C=5;
    total1=(A*2);
    total2=B/C;
    total3=total1+total2;
    total=total3-15;
    cout <<"Total = "<<total<<endl;
    getch();
}
3.


                           A = 20, B=30, C=2, D=5,
E=50
3.1 (A>=B) && (A==A)
3.2 (B+C>A+D)|| (B+C<A+D)&&(D<10)
3.3 (A==20) && (B>=30)
3.4 (50==E ) || (!(D<=E)
3.5 !(D!=5)
3.6 (B+C+20)!=50
3.7 C==(D-3)
3.8 (A/C<=B) && (C+D<=A) || (D>A)
3.9 (A%C+5)==(E/5-10)
3.10 A<B&&D<E


A = 20, B=30, C=2, D=5, E=50
3.1 (A>=B) && (A==A)
/*Program : logic_tst1.cpp
Process : Test logical value of expression
*/
#include <iostream.h>
#include <conio.h>
void main()
{ int A,B;
A=20;
B=30;
cout<< "Display Logic Operation :a";
cout<< "nLogic value of expression
(A>=B)&&(A==A) :" <<(A>=B)&&(A==A);
cout<< "nnValue 1 is true, 0 is false ....press any
key";
getch();
}

More Related Content

What's hot

MFC Cosinus
MFC CosinusMFC Cosinus
MFC Menu
MFC MenuMFC Menu
Assignement of programming & problem solving ass.(3)
Assignement of programming & problem solving ass.(3)Assignement of programming & problem solving ass.(3)
Assignement of programming & problem solving ass.(3)
Syed Umair
 
11 1 포인터
11 1 포인터11 1 포인터
C++ TUTORIAL 8
C++ TUTORIAL 8C++ TUTORIAL 8
C++ TUTORIAL 8
Farhan Ab Rahman
 
Hybrid inheritance
Hybrid inheritanceHybrid inheritance
Hybrid inheritance
zindadili
 
C Programing Solve Presentation -CSE
C Programing Solve Presentation -CSEC Programing Solve Presentation -CSE
C Programing Solve Presentation -CSE
salman ahmed
 
C programing basic input and output
C  programing basic input and outputC  programing basic input and output
C programing basic input and output
dhanajeyan dhanaj
 
Matlab code of chapter 4
Matlab code of chapter 4Matlab code of chapter 4
Matlab code of chapter 4Mohamed El Kiki
 
Lecture#5 Operators in C++
Lecture#5 Operators in C++Lecture#5 Operators in C++
Lecture#5 Operators in C++
NUST Stuff
 
C-- Sample Programs and Screenshots
C-- Sample Programs and ScreenshotsC-- Sample Programs and Screenshots
C-- Sample Programs and Screenshots
Ben Egadah
 
Palindrome number program c
Palindrome number program cPalindrome number program c
Palindrome number program c
mohdshanu
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
Bharat Kalia
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
AhalyaR
 
New presentation oop
New presentation oopNew presentation oop
New presentation oop
Ch shampi Ch shampi
 
Program presentation
Program presentationProgram presentation
Program presentation
MdAlauddinRidoy
 
C++ TUTORIAL 1
C++ TUTORIAL 1C++ TUTORIAL 1
C++ TUTORIAL 1
Farhan Ab Rahman
 

What's hot (20)

MFC Cosinus
MFC CosinusMFC Cosinus
MFC Cosinus
 
MFC Menu
MFC MenuMFC Menu
MFC Menu
 
Assignement of programming & problem solving ass.(3)
Assignement of programming & problem solving ass.(3)Assignement of programming & problem solving ass.(3)
Assignement of programming & problem solving ass.(3)
 
11 1 포인터
11 1 포인터11 1 포인터
11 1 포인터
 
C++ TUTORIAL 8
C++ TUTORIAL 8C++ TUTORIAL 8
C++ TUTORIAL 8
 
Advanced pointer
Advanced pointerAdvanced pointer
Advanced pointer
 
Hybrid inheritance
Hybrid inheritanceHybrid inheritance
Hybrid inheritance
 
C Programing Solve Presentation -CSE
C Programing Solve Presentation -CSEC Programing Solve Presentation -CSE
C Programing Solve Presentation -CSE
 
C programing basic input and output
C  programing basic input and outputC  programing basic input and output
C programing basic input and output
 
Matlab code of chapter 4
Matlab code of chapter 4Matlab code of chapter 4
Matlab code of chapter 4
 
Lecture#5 Operators in C++
Lecture#5 Operators in C++Lecture#5 Operators in C++
Lecture#5 Operators in C++
 
Exam for c
Exam for cExam for c
Exam for c
 
C-- Sample Programs and Screenshots
C-- Sample Programs and ScreenshotsC-- Sample Programs and Screenshots
C-- Sample Programs and Screenshots
 
Vcs15
Vcs15Vcs15
Vcs15
 
Palindrome number program c
Palindrome number program cPalindrome number program c
Palindrome number program c
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
 
New presentation oop
New presentation oopNew presentation oop
New presentation oop
 
Program presentation
Program presentationProgram presentation
Program presentation
 
C++ TUTORIAL 1
C++ TUTORIAL 1C++ TUTORIAL 1
C++ TUTORIAL 1
 

Similar to เฉลยแบบฝึกหัดบทที่ 1

c interview progs.pdf
c interview progs.pdfc interview progs.pdf
c interview progs.pdf
pooja82042
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
vandna123
 
Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)
Syed Umair
 
Lab Manual IV (1).pdf on C++ Programming practice
Lab Manual IV (1).pdf on C++ Programming practiceLab Manual IV (1).pdf on C++ Programming practice
Lab Manual IV (1).pdf on C++ Programming practice
ranaibrahim453
 
Labsheet2 stud
Labsheet2 studLabsheet2 stud
Labsheet2 studrohassanie
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++
Syed Umair
 
C++ assignment
C++ assignmentC++ assignment
C++ assignment
Zohaib Ahmed
 
operator overloading
operator overloadingoperator overloading
operator overloading
Sorath Peetamber
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptx
ssuser3cbb4c
 
Contoh program c++ kalkulator
Contoh program c++ kalkulatorContoh program c++ kalkulator
Contoh program c++ kalkulator
JsHomeIndustry
 
Final DAA_prints.pdf
Final DAA_prints.pdfFinal DAA_prints.pdf
Final DAA_prints.pdf
Yashpatel821746
 
3 rd animation
3 rd animation3 rd animation
3 rd animation
divyalakshmi77
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
Ashishchinu
 
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbpointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
TUSHARGAURAV11
 

Similar to เฉลยแบบฝึกหัดบทที่ 1 (20)

c interview progs.pdf
c interview progs.pdfc interview progs.pdf
c interview progs.pdf
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
 
Qno 1 (d)
Qno 1 (d)Qno 1 (d)
Qno 1 (d)
 
Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)Assignement of programming & problem solving u.s ass.(1)
Assignement of programming & problem solving u.s ass.(1)
 
Lab Manual IV (1).pdf on C++ Programming practice
Lab Manual IV (1).pdf on C++ Programming practiceLab Manual IV (1).pdf on C++ Programming practice
Lab Manual IV (1).pdf on C++ Programming practice
 
Labsheet2
Labsheet2Labsheet2
Labsheet2
 
Labsheet2 stud
Labsheet2 studLabsheet2 stud
Labsheet2 stud
 
Lab 1
Lab 1Lab 1
Lab 1
 
Bijender (1)
Bijender (1)Bijender (1)
Bijender (1)
 
Assignement of c++
Assignement of c++Assignement of c++
Assignement of c++
 
C++ assignment
C++ assignmentC++ assignment
C++ assignment
 
operator overloading
operator overloadingoperator overloading
operator overloading
 
C++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptxC++ lectures all chapters in one slide.pptx
C++ lectures all chapters in one slide.pptx
 
Contoh program c++ kalkulator
Contoh program c++ kalkulatorContoh program c++ kalkulator
Contoh program c++ kalkulator
 
Final DAA_prints.pdf
Final DAA_prints.pdfFinal DAA_prints.pdf
Final DAA_prints.pdf
 
7720
77207720
7720
 
3 rd animation
3 rd animation3 rd animation
3 rd animation
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
 
C++ programs
C++ programsC++ programs
C++ programs
 
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjbpointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
pointer.ppt hfkogfhkigfvjjgdsyhhgfdfghjb
 

More from โทโม๊ะจัง นานะ

บทที่ 4 เรื่องทำงานกับไฟล์ e book
บทที่ 4 เรื่องทำงานกับไฟล์ e bookบทที่ 4 เรื่องทำงานกับไฟล์ e book
บทที่ 4 เรื่องทำงานกับไฟล์ e bookโทโม๊ะจัง นานะ
 
บทที่ 4 เรื่องทำงานกับไฟล์ e book
บทที่ 4 เรื่องทำงานกับไฟล์ e bookบทที่ 4 เรื่องทำงานกับไฟล์ e book
บทที่ 4 เรื่องทำงานกับไฟล์ e bookโทโม๊ะจัง นานะ
 
บทที่ 2 สร้าง e book ง่ายและเร็ว
บทที่ 2 สร้าง e book ง่ายและเร็วบทที่ 2 สร้าง e book ง่ายและเร็ว
บทที่ 2 สร้าง e book ง่ายและเร็วโทโม๊ะจัง นานะ
 
บทที่ 1 ลักษณะทั่วไปของหนังสืออิเล็กทรอนิกส์
บทที่ 1 ลักษณะทั่วไปของหนังสืออิเล็กทรอนิกส์บทที่ 1 ลักษณะทั่วไปของหนังสืออิเล็กทรอนิกส์
บทที่ 1 ลักษณะทั่วไปของหนังสืออิเล็กทรอนิกส์โทโม๊ะจัง นานะ
 

More from โทโม๊ะจัง นานะ (20)

บทที่ 4 เรื่องทำงานกับไฟล์ e book
บทที่ 4 เรื่องทำงานกับไฟล์ e bookบทที่ 4 เรื่องทำงานกับไฟล์ e book
บทที่ 4 เรื่องทำงานกับไฟล์ e book
 
บทที่ 4 เรื่องทำงานกับไฟล์ e book
บทที่ 4 เรื่องทำงานกับไฟล์ e bookบทที่ 4 เรื่องทำงานกับไฟล์ e book
บทที่ 4 เรื่องทำงานกับไฟล์ e book
 
บทที่ 3 การควบคุม e book
บทที่ 3 การควบคุม e bookบทที่ 3 การควบคุม e book
บทที่ 3 การควบคุม e book
 
บทที่ 2 สร้าง e book ง่ายและเร็ว
บทที่ 2 สร้าง e book ง่ายและเร็วบทที่ 2 สร้าง e book ง่ายและเร็ว
บทที่ 2 สร้าง e book ง่ายและเร็ว
 
บทที่ 1 ลักษณะทั่วไปของหนังสืออิเล็กทรอนิกส์
บทที่ 1 ลักษณะทั่วไปของหนังสืออิเล็กทรอนิกส์บทที่ 1 ลักษณะทั่วไปของหนังสืออิเล็กทรอนิกส์
บทที่ 1 ลักษณะทั่วไปของหนังสืออิเล็กทรอนิกส์
 
Chapter1
Chapter1Chapter1
Chapter1
 
Lesson1
Lesson1Lesson1
Lesson1
 
Lesson6
Lesson6Lesson6
Lesson6
 
Lesson5
Lesson5Lesson5
Lesson5
 
Lesson4
Lesson4Lesson4
Lesson4
 
Lesson3
Lesson3Lesson3
Lesson3
 
Lesson2
Lesson2Lesson2
Lesson2
 
Lesson1
Lesson1Lesson1
Lesson1
 
บทที่1
บทที่1บทที่1
บทที่1
 
บท1
บท1บท1
บท1
 
บท2
บท2บท2
บท2
 
บท3
บท3บท3
บท3
 
บท4
บท4บท4
บท4
 
บท5
บท5บท5
บท5
 
บท6
บท6บท6
บท6
 

Recently uploaded

Business Valuation Principles for Entrepreneurs
Business Valuation Principles for EntrepreneursBusiness Valuation Principles for Entrepreneurs
Business Valuation Principles for Entrepreneurs
Ben Wann
 
20240425_ TJ Communications Credentials_compressed.pdf
20240425_ TJ Communications Credentials_compressed.pdf20240425_ TJ Communications Credentials_compressed.pdf
20240425_ TJ Communications Credentials_compressed.pdf
tjcomstrang
 
falcon-invoice-discounting-a-premier-platform-for-investors-in-india
falcon-invoice-discounting-a-premier-platform-for-investors-in-indiafalcon-invoice-discounting-a-premier-platform-for-investors-in-india
falcon-invoice-discounting-a-premier-platform-for-investors-in-india
Falcon Invoice Discounting
 
Affordable Stationery Printing Services in Jaipur | Navpack n Print
Affordable Stationery Printing Services in Jaipur | Navpack n PrintAffordable Stationery Printing Services in Jaipur | Navpack n Print
Affordable Stationery Printing Services in Jaipur | Navpack n Print
Navpack & Print
 
Digital Transformation and IT Strategy Toolkit and Templates
Digital Transformation and IT Strategy Toolkit and TemplatesDigital Transformation and IT Strategy Toolkit and Templates
Digital Transformation and IT Strategy Toolkit and Templates
Aurelien Domont, MBA
 
Memorandum Of Association Constitution of Company.ppt
Memorandum Of Association Constitution of Company.pptMemorandum Of Association Constitution of Company.ppt
Memorandum Of Association Constitution of Company.ppt
seri bangash
 
Skye Residences | Extended Stay Residences Near Toronto Airport
Skye Residences | Extended Stay Residences Near Toronto AirportSkye Residences | Extended Stay Residences Near Toronto Airport
Skye Residences | Extended Stay Residences Near Toronto Airport
marketingjdass
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
taqyed
 
CADAVER AS OUR FIRST TEACHER anatomt in your.pptx
CADAVER AS OUR FIRST TEACHER anatomt in your.pptxCADAVER AS OUR FIRST TEACHER anatomt in your.pptx
CADAVER AS OUR FIRST TEACHER anatomt in your.pptx
fakeloginn69
 
5 Things You Need To Know Before Hiring a Videographer
5 Things You Need To Know Before Hiring a Videographer5 Things You Need To Know Before Hiring a Videographer
5 Things You Need To Know Before Hiring a Videographer
ofm712785
 
Brand Analysis for an artist named Struan
Brand Analysis for an artist named StruanBrand Analysis for an artist named Struan
Brand Analysis for an artist named Struan
sarahvanessa51503
 
What is the TDS Return Filing Due Date for FY 2024-25.pdf
What is the TDS Return Filing Due Date for FY 2024-25.pdfWhat is the TDS Return Filing Due Date for FY 2024-25.pdf
What is the TDS Return Filing Due Date for FY 2024-25.pdf
seoforlegalpillers
 
Search Disrupted Google’s Leaked Documents Rock the SEO World.pdf
Search Disrupted Google’s Leaked Documents Rock the SEO World.pdfSearch Disrupted Google’s Leaked Documents Rock the SEO World.pdf
Search Disrupted Google’s Leaked Documents Rock the SEO World.pdf
Arihant Webtech Pvt. Ltd
 
The-McKinsey-7S-Framework. strategic management
The-McKinsey-7S-Framework. strategic managementThe-McKinsey-7S-Framework. strategic management
The-McKinsey-7S-Framework. strategic management
Bojamma2
 
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdfMeas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
dylandmeas
 
Premium MEAN Stack Development Solutions for Modern Businesses
Premium MEAN Stack Development Solutions for Modern BusinessesPremium MEAN Stack Development Solutions for Modern Businesses
Premium MEAN Stack Development Solutions for Modern Businesses
SynapseIndia
 
Putting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptxPutting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptx
Cynthia Clay
 
Introduction to Amazon company 111111111111
Introduction to Amazon company 111111111111Introduction to Amazon company 111111111111
Introduction to Amazon company 111111111111
zoyaansari11365
 
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdfModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
fisherameliaisabella
 
What are the main advantages of using HR recruiter services.pdf
What are the main advantages of using HR recruiter services.pdfWhat are the main advantages of using HR recruiter services.pdf
What are the main advantages of using HR recruiter services.pdf
HumanResourceDimensi1
 

Recently uploaded (20)

Business Valuation Principles for Entrepreneurs
Business Valuation Principles for EntrepreneursBusiness Valuation Principles for Entrepreneurs
Business Valuation Principles for Entrepreneurs
 
20240425_ TJ Communications Credentials_compressed.pdf
20240425_ TJ Communications Credentials_compressed.pdf20240425_ TJ Communications Credentials_compressed.pdf
20240425_ TJ Communications Credentials_compressed.pdf
 
falcon-invoice-discounting-a-premier-platform-for-investors-in-india
falcon-invoice-discounting-a-premier-platform-for-investors-in-indiafalcon-invoice-discounting-a-premier-platform-for-investors-in-india
falcon-invoice-discounting-a-premier-platform-for-investors-in-india
 
Affordable Stationery Printing Services in Jaipur | Navpack n Print
Affordable Stationery Printing Services in Jaipur | Navpack n PrintAffordable Stationery Printing Services in Jaipur | Navpack n Print
Affordable Stationery Printing Services in Jaipur | Navpack n Print
 
Digital Transformation and IT Strategy Toolkit and Templates
Digital Transformation and IT Strategy Toolkit and TemplatesDigital Transformation and IT Strategy Toolkit and Templates
Digital Transformation and IT Strategy Toolkit and Templates
 
Memorandum Of Association Constitution of Company.ppt
Memorandum Of Association Constitution of Company.pptMemorandum Of Association Constitution of Company.ppt
Memorandum Of Association Constitution of Company.ppt
 
Skye Residences | Extended Stay Residences Near Toronto Airport
Skye Residences | Extended Stay Residences Near Toronto AirportSkye Residences | Extended Stay Residences Near Toronto Airport
Skye Residences | Extended Stay Residences Near Toronto Airport
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
 
CADAVER AS OUR FIRST TEACHER anatomt in your.pptx
CADAVER AS OUR FIRST TEACHER anatomt in your.pptxCADAVER AS OUR FIRST TEACHER anatomt in your.pptx
CADAVER AS OUR FIRST TEACHER anatomt in your.pptx
 
5 Things You Need To Know Before Hiring a Videographer
5 Things You Need To Know Before Hiring a Videographer5 Things You Need To Know Before Hiring a Videographer
5 Things You Need To Know Before Hiring a Videographer
 
Brand Analysis for an artist named Struan
Brand Analysis for an artist named StruanBrand Analysis for an artist named Struan
Brand Analysis for an artist named Struan
 
What is the TDS Return Filing Due Date for FY 2024-25.pdf
What is the TDS Return Filing Due Date for FY 2024-25.pdfWhat is the TDS Return Filing Due Date for FY 2024-25.pdf
What is the TDS Return Filing Due Date for FY 2024-25.pdf
 
Search Disrupted Google’s Leaked Documents Rock the SEO World.pdf
Search Disrupted Google’s Leaked Documents Rock the SEO World.pdfSearch Disrupted Google’s Leaked Documents Rock the SEO World.pdf
Search Disrupted Google’s Leaked Documents Rock the SEO World.pdf
 
The-McKinsey-7S-Framework. strategic management
The-McKinsey-7S-Framework. strategic managementThe-McKinsey-7S-Framework. strategic management
The-McKinsey-7S-Framework. strategic management
 
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdfMeas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
Meas_Dylan_DMBS_PB1_2024-05XX_Revised.pdf
 
Premium MEAN Stack Development Solutions for Modern Businesses
Premium MEAN Stack Development Solutions for Modern BusinessesPremium MEAN Stack Development Solutions for Modern Businesses
Premium MEAN Stack Development Solutions for Modern Businesses
 
Putting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptxPutting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptx
 
Introduction to Amazon company 111111111111
Introduction to Amazon company 111111111111Introduction to Amazon company 111111111111
Introduction to Amazon company 111111111111
 
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdfModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
ModelingMarketingStrategiesMKS.CollumbiaUniversitypdf
 
What are the main advantages of using HR recruiter services.pdf
What are the main advantages of using HR recruiter services.pdfWhat are the main advantages of using HR recruiter services.pdf
What are the main advantages of using HR recruiter services.pdf
 

เฉลยแบบฝึกหัดบทที่ 1

  • 1. 1. A=50 B=30 C=5 D=3 E = 10 1.1 (A+B)*(E-D) 1.6 --D+C+B-- 1.2 ++D+C*E 1.7 25*D/5+10 1.3 (25+A)/C+B 1.8 A+B--+D 1.4 A*=D 1.9 C*2+E*5 1.5 20*C+B+++D/2 1.10 (A*2)+B/C- 15 A=50 B=30 C=5 D=3 E = 10 (A+B)*(E-D) /*Program : variable1.cpp Process : Display set value of varible */ #include <iostream.h> #include <conio.h> void main() { int A B,D,E,; A=50;
  • 2. B=30; D=3; E=10; total1=(A+B); total2=(E-D); total=total1*total2; cout <<"Total = "<< total<<endl; getch(); } A=50 B=30 C=5 D=3 E = 10 ++D+C*E /*Program : variable2.cpp Process : Display set value of varible */ #include <iostream.h> #include <conio.h> void main() { int C,D,E;
  • 3. C=5; D=3; E=10; total1=++D; total2=C*E; total=total1*total2; cout <<"Total = "<< total<<endl; getch(); }
  • 4. A=50 B=30 C=5 D=3 E = 10 1.3 (25+A)/C+B /*Program : variable3.cpp Process : Display set value of varible */ #include <iostream.h> #include <conio.h> void main() { int A B,C; A=50; B=30; C=5; total1=(25+A); total2=total1/C; total=total2+B; cout <<"Total = "<< total<<endl; getch(); }
  • 5. A=50 B=30 C=5 D=3 E = 10 14. A*=D /*Program : variable4.cpp Process : Display set value of varible */ #include <iostream.h>
  • 6. #include <conio.h> void main() { int A D; A=50; D=10; total=A*=D; cout <<"Total = "<<total<<endl; getch(); }
  • 7. A=50 B=30 C=5 D=3 E = 10 1.5 20*C+B+++D/2 /*Program : variable5.cpp Process : Display set value of varible */ #include <iostream.h> #include <conio.h> void main() { int A B,C; B=30; C=5; D=3; total1=B++; total2=20*C; total3=D/2; total4=total2+total1;
  • 8. total=total4+total3; cout <<"Total = "<<total<<endl; getch(); } A=50 B=30 C=5 D=3 E = 10 1.6 --D+C+B— /*Program : variable6.cpp
  • 9. Process : Display set value of varible */ #include <iostream.h> #include <conio.h> void main() { int B,C,D; B=30; C=5; D=3; total1=--D; total2=B--; total3=total1+C; total=total3+total2; cout <<"Total = "<<total<<endl; getch(); }
  • 10. A=50 B=30 C=5 D=3 E = 10 1.7 25*D/5+10 /*Program : variable7.cpp Process : Display set value of varible */ #include <iostream.h> #include <conio.h> void main() { int D; D=3; total1=25*D; total2=total1/5; total=total2+10; cout <<"Total = "<<total<<endl;
  • 12. 1.8 A+B--+D /*Program : variable8.cpp Process : Display set value of varible */ #include <iostream.h> #include <conio.h> void main() { int A,B,D; A=50; B=30; D=3; total1=B--; total2=A+total1; total=total2+D; cout <<"Total = "<<total<<endl; getch(); }
  • 13. A=50 B=30 C=5 D=3 E = 10 1.9 C*2+E*5 /*Program : variable9.cpp Process : Display set value of varible */ #include <iostream.h> #include <conio.h> void main() { int C,E; C=5; E=10; total1=C*2;
  • 14. total2=E*5; total=total1+total2; cout <<"Total = "<<total<<endl; getch(); }
  • 15. A=50 B=30 C=5 D=3 E = 10 1.10 (A*2)+B/C-15 /*Program : variable10.cpp Process : Display set value of varible */ #include <iostream.h> #include <conio.h> void main() { int A,B,C; A=50; B=30; C=5; total1=(A*2); total2=B/C; total3=total1+total2; total=total3-15; cout <<"Total = "<<total<<endl; getch(); }
  • 16. 3. A = 20, B=30, C=2, D=5, E=50 3.1 (A>=B) && (A==A) 3.2 (B+C>A+D)|| (B+C<A+D)&&(D<10) 3.3 (A==20) && (B>=30) 3.4 (50==E ) || (!(D<=E) 3.5 !(D!=5) 3.6 (B+C+20)!=50
  • 17. 3.7 C==(D-3) 3.8 (A/C<=B) && (C+D<=A) || (D>A) 3.9 (A%C+5)==(E/5-10) 3.10 A<B&&D<E A = 20, B=30, C=2, D=5, E=50 3.1 (A>=B) && (A==A) /*Program : logic_tst1.cpp Process : Test logical value of expression */ #include <iostream.h> #include <conio.h> void main() { int A,B; A=20; B=30; cout<< "Display Logic Operation :a"; cout<< "nLogic value of expression (A>=B)&&(A==A) :" <<(A>=B)&&(A==A); cout<< "nnValue 1 is true, 0 is false ....press any key"; getch();
  • 18. }