SlideShare une entreprise Scribd logo
1  sur  10
“Concept of C”
Rohan K. Gajre
WAP To do addition of two
Number but Declare One variable
Yes it is possible in 3 different way in C
and C++ programming
Use function as well as Scope Resolution
operator
Function is block we call it n number of
times
Using Scope Resolution we use global
values
1 Using function
int a;
int add();
void main() {
clrscr();
printf(“nt Addition 2 Number is %d”,add()+add());
getch(); }
int add() {
printf(“nt Enter Number”);
scanf(“%d”,&a);
return a;
}
Description of First program
In above program declare only one
variable “a” and declare one function
add()
In printf() just calling function 2 times
for addition. In function definition
accepting values for variable a using
scanf() and return values of a
2 Scope Resoulation
int x;
void add();
void main() {
clrscr();
add();
getch(); }
void add() {
cout<<“nt Enter Number”;
cin>>::x>>x;
x+=x+::x;
cout<<x; }
Description of Second program
In this program declare only one
variable “x” declare one default
function add()
Using “cin” statement accepting value
for X and scope value for same then
doing addition and print result
3 Function with return value
int p;
int add();
void main() {
clrscr();
cout<<“nt Add is”<<add ()+add();
getch(); }
int add() {
cout<<“nt Enter Number”;
cin>>p;
return p;
}
Description of Third program
Third program is same like as first
program only variable name is P instead of
a.
Thank you!
Thank you!

Contenu connexe

Tendances

Ffffffffffff
FfffffffffffFfffffffffff
Ffffffffffffmohdshanu
 
CS106 Lab 10 - Functions (passing by value)
CS106 Lab 10 - Functions (passing by value)CS106 Lab 10 - Functions (passing by value)
CS106 Lab 10 - Functions (passing by value)Nada Kamel
 
Infix to Prefix (Conversion, Evaluation, Code)
Infix to Prefix (Conversion, Evaluation, Code)Infix to Prefix (Conversion, Evaluation, Code)
Infix to Prefix (Conversion, Evaluation, Code)Ahmed Khateeb
 
Asymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using CAsymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using CMeghaj Mallick
 
CS151 Functions lecture
CS151 Functions lectureCS151 Functions lecture
CS151 Functions lectureRudy Martinez
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10alish sha
 
Introduction to design and analysis of algorithm
Introduction to design and analysis of algorithmIntroduction to design and analysis of algorithm
Introduction to design and analysis of algorithmDevaKumari Vijay
 
CS106 Lab 6 - While and Do..While loop
CS106 Lab 6 - While and Do..While loopCS106 Lab 6 - While and Do..While loop
CS106 Lab 6 - While and Do..While loopNada Kamel
 
Two C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp InsightsTwo C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp InsightsAlison Chaiken
 
CS106 Lab 11 - Functions (passing by reference)
CS106 Lab 11 - Functions (passing by reference)CS106 Lab 11 - Functions (passing by reference)
CS106 Lab 11 - Functions (passing by reference)Nada Kamel
 
PF LAB ASSIGNMENT
PF LAB ASSIGNMENTPF LAB ASSIGNMENT
PF LAB ASSIGNMENTminqadtahir
 
CS106 Lab 8 - Nested loops
CS106 Lab 8 - Nested loopsCS106 Lab 8 - Nested loops
CS106 Lab 8 - Nested loopsNada Kamel
 

Tendances (20)

Ffffffffffff
FfffffffffffFfffffffffff
Ffffffffffff
 
Activities on Software Development
Activities on Software DevelopmentActivities on Software Development
Activities on Software Development
 
Arithmetic operator
Arithmetic operatorArithmetic operator
Arithmetic operator
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
 
CS106 Lab 10 - Functions (passing by value)
CS106 Lab 10 - Functions (passing by value)CS106 Lab 10 - Functions (passing by value)
CS106 Lab 10 - Functions (passing by value)
 
Infix to Prefix (Conversion, Evaluation, Code)
Infix to Prefix (Conversion, Evaluation, Code)Infix to Prefix (Conversion, Evaluation, Code)
Infix to Prefix (Conversion, Evaluation, Code)
 
Ankita sharma focp
Ankita sharma focpAnkita sharma focp
Ankita sharma focp
 
Asymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using CAsymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using C
 
Pslb lab manual
Pslb lab manualPslb lab manual
Pslb lab manual
 
CS151 Functions lecture
CS151 Functions lectureCS151 Functions lecture
CS151 Functions lecture
 
Prefix Postfix
Prefix PostfixPrefix Postfix
Prefix Postfix
 
Practical no 3
Practical no 3Practical no 3
Practical no 3
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10
 
Introduction to design and analysis of algorithm
Introduction to design and analysis of algorithmIntroduction to design and analysis of algorithm
Introduction to design and analysis of algorithm
 
CS106 Lab 6 - While and Do..While loop
CS106 Lab 6 - While and Do..While loopCS106 Lab 6 - While and Do..While loop
CS106 Lab 6 - While and Do..While loop
 
Two C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp InsightsTwo C++ Tools: Compiler Explorer and Cpp Insights
Two C++ Tools: Compiler Explorer and Cpp Insights
 
CS106 Lab 11 - Functions (passing by reference)
CS106 Lab 11 - Functions (passing by reference)CS106 Lab 11 - Functions (passing by reference)
CS106 Lab 11 - Functions (passing by reference)
 
PF LAB ASSIGNMENT
PF LAB ASSIGNMENTPF LAB ASSIGNMENT
PF LAB ASSIGNMENT
 
CS106 Lab 8 - Nested loops
CS106 Lab 8 - Nested loopsCS106 Lab 8 - Nested loops
CS106 Lab 8 - Nested loops
 
Labsheet_3
Labsheet_3Labsheet_3
Labsheet_3
 

En vedette

Introduction to the c programming language (amazing and easy book for beginners)
Introduction to the c programming language (amazing and easy book for beginners)Introduction to the c programming language (amazing and easy book for beginners)
Introduction to the c programming language (amazing and easy book for beginners)mujeeb memon
 
Introduction to programming with c,
Introduction to programming with c,Introduction to programming with c,
Introduction to programming with c,Hossain Md Shakhawat
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programmingTarun Sharma
 
Overview of c language
Overview of c languageOverview of c language
Overview of c languageshalini392
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGAbhishek Dwivedi
 
PayPal Türkiye- E-İhracat Araştırması
PayPal Türkiye- E-İhracat AraştırmasıPayPal Türkiye- E-İhracat Araştırması
PayPal Türkiye- E-İhracat AraştırmasıWebrazzi
 
Programming in C Basics
Programming in C BasicsProgramming in C Basics
Programming in C BasicsBharat Kalia
 
Updated field oriented control of induction motor.pptx
Updated field oriented control of induction motor.pptxUpdated field oriented control of induction motor.pptx
Updated field oriented control of induction motor.pptxMohit Sharma
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingManoj Tyagi
 
6 Ways Small Businesses Can Make the Most of Twitter
6 Ways Small Businesses Can Make the Most of Twitter 6 Ways Small Businesses Can Make the Most of Twitter
6 Ways Small Businesses Can Make the Most of Twitter LinkNow Media
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programmingavikdhupar
 
The Real Value of Small Business Apps
The Real Value of Small Business AppsThe Real Value of Small Business Apps
The Real Value of Small Business AppsIntuit Inc.
 
Ten Characteristics Common To Highly Effective Entrepreneurs
Ten Characteristics Common To Highly Effective EntrepreneursTen Characteristics Common To Highly Effective Entrepreneurs
Ten Characteristics Common To Highly Effective EntrepreneursAbhishek Shah
 
15 Small Business Tips to Hiring Rock Star Talent
15 Small Business Tips to Hiring Rock Star Talent15 Small Business Tips to Hiring Rock Star Talent
15 Small Business Tips to Hiring Rock Star TalentLinkedIn for Small Business
 
structured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsstructured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsOMWOMA JACKSON
 
Startups are Hard. Like, Really Hard. @luketucker
Startups are Hard. Like, Really Hard. @luketuckerStartups are Hard. Like, Really Hard. @luketucker
Startups are Hard. Like, Really Hard. @luketuckerEmpowered Presentations
 

En vedette (20)

Introduction to the c programming language (amazing and easy book for beginners)
Introduction to the c programming language (amazing and easy book for beginners)Introduction to the c programming language (amazing and easy book for beginners)
Introduction to the c programming language (amazing and easy book for beginners)
 
Introduction to programming with c,
Introduction to programming with c,Introduction to programming with c,
Introduction to programming with c,
 
Introduction of c programming
Introduction of c programmingIntroduction of c programming
Introduction of c programming
 
Overview of c language
Overview of c languageOverview of c language
Overview of c language
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
INTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMINGINTRODUCTION TO C PROGRAMMING
INTRODUCTION TO C PROGRAMMING
 
PayPal Türkiye- E-İhracat Araştırması
PayPal Türkiye- E-İhracat AraştırmasıPayPal Türkiye- E-İhracat Araştırması
PayPal Türkiye- E-İhracat Araştırması
 
Programming in C Basics
Programming in C BasicsProgramming in C Basics
Programming in C Basics
 
C language basics
C language basicsC language basics
C language basics
 
Updated field oriented control of induction motor.pptx
Updated field oriented control of induction motor.pptxUpdated field oriented control of induction motor.pptx
Updated field oriented control of induction motor.pptx
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
6 Ways Small Businesses Can Make the Most of Twitter
6 Ways Small Businesses Can Make the Most of Twitter 6 Ways Small Businesses Can Make the Most of Twitter
6 Ways Small Businesses Can Make the Most of Twitter
 
C ppt
C pptC ppt
C ppt
 
Basics of C programming
Basics of C programmingBasics of C programming
Basics of C programming
 
The Real Value of Small Business Apps
The Real Value of Small Business AppsThe Real Value of Small Business Apps
The Real Value of Small Business Apps
 
Ten Characteristics Common To Highly Effective Entrepreneurs
Ten Characteristics Common To Highly Effective EntrepreneursTen Characteristics Common To Highly Effective Entrepreneurs
Ten Characteristics Common To Highly Effective Entrepreneurs
 
15 Small Business Tips to Hiring Rock Star Talent
15 Small Business Tips to Hiring Rock Star Talent15 Small Business Tips to Hiring Rock Star Talent
15 Small Business Tips to Hiring Rock Star Talent
 
structured programming Introduction to c fundamentals
structured programming Introduction to c fundamentalsstructured programming Introduction to c fundamentals
structured programming Introduction to c fundamentals
 
Startups are Hard. Like, Really Hard. @luketucker
Startups are Hard. Like, Really Hard. @luketuckerStartups are Hard. Like, Really Hard. @luketucker
Startups are Hard. Like, Really Hard. @luketucker
 

Similaire à Concept of c

Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILEDipta Saha
 
cuptopointer-180804092048-190306091149 (2).pdf
cuptopointer-180804092048-190306091149 (2).pdfcuptopointer-180804092048-190306091149 (2).pdf
cuptopointer-180804092048-190306091149 (2).pdfYashwanthCse
 
C++ Function
C++ FunctionC++ Function
C++ FunctionHajar
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cppNilesh Dalvi
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C ProgrammingShuvongkor Barman
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and typesimtiazalijoono
 
C++ lab assignment
C++ lab assignmentC++ lab assignment
C++ lab assignmentSaket Pathak
 
Function in c program
Function in c programFunction in c program
Function in c programumesh patil
 
function in in thi pdf you will learn what is fu...
function in  in thi pdf you will learn   what                           is fu...function in  in thi pdf you will learn   what                           is fu...
function in in thi pdf you will learn what is fu...kushwahashivam413
 
Operator overloading2
Operator overloading2Operator overloading2
Operator overloading2zindadili
 
Operators-computer programming and utilzation
Operators-computer programming and utilzationOperators-computer programming and utilzation
Operators-computer programming and utilzationKaushal Patel
 

Similaire à Concept of c (20)

Programming in C Presentation upto FILE
Programming in C Presentation upto FILEProgramming in C Presentation upto FILE
Programming in C Presentation upto FILE
 
cuptopointer-180804092048-190306091149 (2).pdf
cuptopointer-180804092048-190306091149 (2).pdfcuptopointer-180804092048-190306091149 (2).pdf
cuptopointer-180804092048-190306091149 (2).pdf
 
C++ Function
C++ FunctionC++ Function
C++ Function
 
Unit 4.pdf
Unit 4.pdfUnit 4.pdf
Unit 4.pdf
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and types
 
C++ lab assignment
C++ lab assignmentC++ lab assignment
C++ lab assignment
 
Array Cont
Array ContArray Cont
Array Cont
 
Function in c program
Function in c programFunction in c program
Function in c program
 
function in in thi pdf you will learn what is fu...
function in  in thi pdf you will learn   what                           is fu...function in  in thi pdf you will learn   what                           is fu...
function in in thi pdf you will learn what is fu...
 
Operator overloading2
Operator overloading2Operator overloading2
Operator overloading2
 
Function in c
Function in cFunction in c
Function in c
 
Functionincprogram
FunctionincprogramFunctionincprogram
Functionincprogram
 
Progr3
Progr3Progr3
Progr3
 
Function in c
Function in cFunction in c
Function in c
 
Operators-computer programming and utilzation
Operators-computer programming and utilzationOperators-computer programming and utilzation
Operators-computer programming and utilzation
 
unit_2.pptx
unit_2.pptxunit_2.pptx
unit_2.pptx
 
function_v1.ppt
function_v1.pptfunction_v1.ppt
function_v1.ppt
 
function_v1.ppt
function_v1.pptfunction_v1.ppt
function_v1.ppt
 

Dernier

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Dernier (20)

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

Concept of c

  • 2. WAP To do addition of two Number but Declare One variable Yes it is possible in 3 different way in C and C++ programming Use function as well as Scope Resolution operator Function is block we call it n number of times Using Scope Resolution we use global values
  • 3. 1 Using function int a; int add(); void main() { clrscr(); printf(“nt Addition 2 Number is %d”,add()+add()); getch(); } int add() { printf(“nt Enter Number”); scanf(“%d”,&a); return a; }
  • 4. Description of First program In above program declare only one variable “a” and declare one function add() In printf() just calling function 2 times for addition. In function definition accepting values for variable a using scanf() and return values of a
  • 5. 2 Scope Resoulation int x; void add(); void main() { clrscr(); add(); getch(); } void add() { cout<<“nt Enter Number”; cin>>::x>>x; x+=x+::x; cout<<x; }
  • 6. Description of Second program In this program declare only one variable “x” declare one default function add() Using “cin” statement accepting value for X and scope value for same then doing addition and print result
  • 7. 3 Function with return value int p; int add(); void main() { clrscr(); cout<<“nt Add is”<<add ()+add(); getch(); } int add() { cout<<“nt Enter Number”; cin>>p; return p; }
  • 8. Description of Third program Third program is same like as first program only variable name is P instead of a.