SlideShare a Scribd company logo
1 of 11
Mathematical Function
1. atan()
2. cos()
3. div()
4. modf()
5. sin()
Danger zone 1
atan()
 In C programming atan() function computes the arc tangent(inverse tangent) of an argument.
 Function atan() takes single argument and returns the value in radians.
 Returned value of atan is of type double.
o Header File : Math.h
o Syntax : double atan(argument);
*EXAMPLE*
#include <stdio.h>
#include <math.h>
#define PI 3.141592654
void main()
{
float num;
double result;
printf("Enter the parameter: ");
scanf("%f",&num);
result=atan(num);
printf("Inverse of tan(%.2f)=%.2f in
radians",num,result);
/* ------ Converting radians to degree -------- */
result=(result*180)/PI;
printf("nInverse of tan(%.2f)=%.2f in
degrees",num,result);
}
Danger zone 2
Output :
Enter the parameter: 1
Inverse of cos(1.00)=0.79 in radians
Inverse of cos(1.00)=45 in degrees
Danger zone 3
 In C programming, cos() function computes the cosine of an argument.
 Function cos() takes the value in radian and returns value in type double.
o Header file : Math.h
o Syntax :double cos(argument);
*Example*
#include <stdio.h>
#include <math.h>
#define PI 3.141592654
void main()
{
double arg,result;
printf("Enter the argument in degrees: ");
scanf("%lf",&arg);
/*------ Converting to radian --------*/
arg=(arg*PI)/180;
result=cos(arg);
printf("cos of %.2lf radian = %.2lf",arg, result);
}
Danger zone 2
Output :
Enter the argument in degrees: 30
Cos of 0.52 radian = 0.87
Danger zone 4
Div() Integer Division
 In the C Programming Language, the div function divides numerator by denominator.
Based on that division calculation, the div function returns a structure containing two
members - quotient and remainder.
o Header file : #include <stdlib.h>
o Syntax : div_t div(int numerator, int denominator);
Parameters or Arguments
Numerator:The value that is divided by denominator in the division calculation.
Denominator:The value divided into numerator in the division calculation. So if
numerator is 10 and denominator is 2, then 10 would be divided by 2.
Returns
The div function returns a structure with the resulting quotient and remainder based on
the division calculation.
Danger zone 5
*Example*
#include <stdio.h>
#include <stdlib.h>
void main ()
{
div_t output;
output = div(27, 4);
printf("Quotient part of (27/ 4) = %dn", output.quot);
printf("Remainder part of (27/4) = %dn", output.rem);
output = div(27, 3);
printf("Quotient part of (27/ 3) = %dn", output.quot);
printf("Remainder part of (27/3) = %dn", output.rem);
getch();
}
Danger zone 2
Output :
Quotient part of (27/4) = 6
Remainder part of (27/4) =3
Quotient part of (27/3) = 9
Remainder part of (27/3) = 0
• In C programming, sin() function computes the sine of an argument. Function
sin() takes the value in radian and returns value in type double.
Header file : Math.h
Syntax : double sin (argument);
*Example*
#include <stdio.h>
#include <math.h>
#define PI 3.141592654
void main()
{ double arg,result;
printf("Enter the argument in degrees: ");
scanf("%lf",&arg);
/*------ Converting to radians --------*/
arg=(arg*PI)/180; result=sin(arg);
printf("sin(%.2lf) [In radian] = %.2lf",arg, result);
}
Sin()
Danger zone 2
Output :
Enter the argument in degrees:
30cos(0.52) [In radian] = 0.50
Mathematics Function in C ,ppt

More Related Content

What's hot (20)

Functions in c language
Functions in c language Functions in c language
Functions in c language
 
System Programming Unit IV
System Programming Unit IVSystem Programming Unit IV
System Programming Unit IV
 
Operators
OperatorsOperators
Operators
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
 
C fundamental
C fundamentalC fundamental
C fundamental
 
Control structures in c
Control structures in cControl structures in c
Control structures in c
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Types of function call
Types of function callTypes of function call
Types of function call
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
 
COMPUTER ORGANIZATION NOTES Unit 7
COMPUTER ORGANIZATION NOTES Unit 7COMPUTER ORGANIZATION NOTES Unit 7
COMPUTER ORGANIZATION NOTES Unit 7
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
 
Operation on string presentation
Operation on string presentationOperation on string presentation
Operation on string presentation
 
File handling in c
File handling in cFile handling in c
File handling in c
 
Features of c language 1
Features of c language 1Features of c language 1
Features of c language 1
 
Structure in C
Structure in CStructure in C
Structure in C
 
Pointer in c
Pointer in cPointer in c
Pointer in c
 
C keywords and identifiers
C keywords and identifiersC keywords and identifiers
C keywords and identifiers
 
Managing input and output operations in c
Managing input and output operations in cManaging input and output operations in c
Managing input and output operations in c
 
functions of C++
functions of C++functions of C++
functions of C++
 
Clanguage
ClanguageClanguage
Clanguage
 

Similar to Mathematics Function in C ,ppt

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
 
Program flowchart
Program flowchartProgram flowchart
Program flowchartSowri Rajan
 
L25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxL25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxhappycocoman
 
write the To Dos to get the exact outputNOte A valid Fraction .pdf
write the To Dos to get the exact outputNOte A valid Fraction .pdfwrite the To Dos to get the exact outputNOte A valid Fraction .pdf
write the To Dos to get the exact outputNOte A valid Fraction .pdfjyothimuppasani1
 
The best every notes on c language is here check it out
The best every notes on c language is here check it outThe best every notes on c language is here check it out
The best every notes on c language is here check it outrajatryadav22
 
PROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxPROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxNithya K
 
C aptitude.2doc
C aptitude.2docC aptitude.2doc
C aptitude.2docSrikanth
 
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1Little Tukta Lita
 
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTES
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTESUnit 1- PROGRAMMING IN C OPERATORS LECTURER NOTES
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTESLeahRachael
 

Similar to Mathematics Function in C ,ppt (20)

Functions
FunctionsFunctions
Functions
 
7 functions
7  functions7  functions
7 functions
 
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...
 
Cpl
CplCpl
Cpl
 
Program flowchart
Program flowchartProgram flowchart
Program flowchart
 
C++ manual Report Full
C++ manual Report FullC++ manual Report Full
C++ manual Report Full
 
L25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxL25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptx
 
write the To Dos to get the exact outputNOte A valid Fraction .pdf
write the To Dos to get the exact outputNOte A valid Fraction .pdfwrite the To Dos to get the exact outputNOte A valid Fraction .pdf
write the To Dos to get the exact outputNOte A valid Fraction .pdf
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
C programs
C programsC programs
C programs
 
9.C Programming
9.C Programming9.C Programming
9.C Programming
 
Advanced C - Part 2
Advanced C - Part 2Advanced C - Part 2
Advanced C - Part 2
 
The best every notes on c language is here check it out
The best every notes on c language is here check it outThe best every notes on c language is here check it out
The best every notes on c language is here check it out
 
PROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxPROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptx
 
C aptitude.2doc
C aptitude.2docC aptitude.2doc
C aptitude.2doc
 
Captitude 2doc-100627004318-phpapp01
Captitude 2doc-100627004318-phpapp01Captitude 2doc-100627004318-phpapp01
Captitude 2doc-100627004318-phpapp01
 
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6  1
ฟังก์ชั่นย่อยและโปรแกรมมาตรฐาน ม. 6 1
 
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTES
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTESUnit 1- PROGRAMMING IN C OPERATORS LECTURER NOTES
Unit 1- PROGRAMMING IN C OPERATORS LECTURER NOTES
 
Functions in c
Functions in cFunctions in c
Functions in c
 
functions
functionsfunctions
functions
 

Recently uploaded

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
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
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 

Recently uploaded (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
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
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 

Mathematics Function in C ,ppt

  • 1. Mathematical Function 1. atan() 2. cos() 3. div() 4. modf() 5. sin()
  • 2. Danger zone 1 atan()  In C programming atan() function computes the arc tangent(inverse tangent) of an argument.  Function atan() takes single argument and returns the value in radians.  Returned value of atan is of type double. o Header File : Math.h o Syntax : double atan(argument); *EXAMPLE* #include <stdio.h> #include <math.h> #define PI 3.141592654 void main() { float num; double result; printf("Enter the parameter: "); scanf("%f",&num); result=atan(num); printf("Inverse of tan(%.2f)=%.2f in radians",num,result); /* ------ Converting radians to degree -------- */ result=(result*180)/PI; printf("nInverse of tan(%.2f)=%.2f in degrees",num,result); }
  • 3. Danger zone 2 Output : Enter the parameter: 1 Inverse of cos(1.00)=0.79 in radians Inverse of cos(1.00)=45 in degrees
  • 4. Danger zone 3  In C programming, cos() function computes the cosine of an argument.  Function cos() takes the value in radian and returns value in type double. o Header file : Math.h o Syntax :double cos(argument); *Example* #include <stdio.h> #include <math.h> #define PI 3.141592654 void main() { double arg,result; printf("Enter the argument in degrees: "); scanf("%lf",&arg); /*------ Converting to radian --------*/ arg=(arg*PI)/180; result=cos(arg); printf("cos of %.2lf radian = %.2lf",arg, result); }
  • 5. Danger zone 2 Output : Enter the argument in degrees: 30 Cos of 0.52 radian = 0.87
  • 6. Danger zone 4 Div() Integer Division  In the C Programming Language, the div function divides numerator by denominator. Based on that division calculation, the div function returns a structure containing two members - quotient and remainder. o Header file : #include <stdlib.h> o Syntax : div_t div(int numerator, int denominator); Parameters or Arguments Numerator:The value that is divided by denominator in the division calculation. Denominator:The value divided into numerator in the division calculation. So if numerator is 10 and denominator is 2, then 10 would be divided by 2. Returns The div function returns a structure with the resulting quotient and remainder based on the division calculation.
  • 7. Danger zone 5 *Example* #include <stdio.h> #include <stdlib.h> void main () { div_t output; output = div(27, 4); printf("Quotient part of (27/ 4) = %dn", output.quot); printf("Remainder part of (27/4) = %dn", output.rem); output = div(27, 3); printf("Quotient part of (27/ 3) = %dn", output.quot); printf("Remainder part of (27/3) = %dn", output.rem); getch(); }
  • 8. Danger zone 2 Output : Quotient part of (27/4) = 6 Remainder part of (27/4) =3 Quotient part of (27/3) = 9 Remainder part of (27/3) = 0
  • 9. • In C programming, sin() function computes the sine of an argument. Function sin() takes the value in radian and returns value in type double. Header file : Math.h Syntax : double sin (argument); *Example* #include <stdio.h> #include <math.h> #define PI 3.141592654 void main() { double arg,result; printf("Enter the argument in degrees: "); scanf("%lf",&arg); /*------ Converting to radians --------*/ arg=(arg*PI)/180; result=sin(arg); printf("sin(%.2lf) [In radian] = %.2lf",arg, result); } Sin()
  • 10. Danger zone 2 Output : Enter the argument in degrees: 30cos(0.52) [In radian] = 0.50