This document discusses different types of functions in C programming. It provides examples of functions with no arguments and no return value, functions with arguments and no return value, functions with arguments and return value, functions with no arguments but return value, and functions that return multiple values. The examples demonstrate how to define and call each type of function.
PowerPoint presentation of functions in C language. It will give you brief idea how function works in C along with its unique features like return statement.
hey this is Rupendra choudhary..!! i shared my "c" lang ppt..!!! u just goto that ppt if u r in deep with "c" ..!!! i create after i hv played a much with "c"..(sorry bt ppt is slightly disturbd may be due to unsupportable msppt2010 by slideshare)...find me on rupendrachoudhary1990@gmail.com or https://rupendrachoudhary.wordpress.com
PowerPoint presentation of functions in C language. It will give you brief idea how function works in C along with its unique features like return statement.
hey this is Rupendra choudhary..!! i shared my "c" lang ppt..!!! u just goto that ppt if u r in deep with "c" ..!!! i create after i hv played a much with "c"..(sorry bt ppt is slightly disturbd may be due to unsupportable msppt2010 by slideshare)...find me on rupendrachoudhary1990@gmail.com or https://rupendrachoudhary.wordpress.com
The ppt describes usage of functions in c language. Showing basic use of function and determining the differences between function call by value and function call by reference using pointer. It also includes valid use in swapping two numbers in c along with different outputs. Overall its a basic note for c language.
Programming Fundamentals Arrays and Strings imtiazalijoono
Programming Fundamentals
Arrays and Strings
• Arrays
• Initializing arrays
• Multidimensional arrays
• Arrays as arguments to functions
• Strings
• String functions
Accessing Individual Components
Declaring Arrays
Arrays: Example Garbage
Multidimensional Arrays
1) Write a C program using arrays that produces the multiplication of two 2x2 matrices.
3-Dimensional Array
Write a program of your own choice that makes use of arrays of more than 2 dimensions.
2-Dimensional Arrays
The ppt describes usage of functions in c language. Showing basic use of function and determining the differences between function call by value and function call by reference using pointer. It also includes valid use in swapping two numbers in c along with different outputs. Overall its a basic note for c language.
Programming Fundamentals Arrays and Strings imtiazalijoono
Programming Fundamentals
Arrays and Strings
• Arrays
• Initializing arrays
• Multidimensional arrays
• Arrays as arguments to functions
• Strings
• String functions
Accessing Individual Components
Declaring Arrays
Arrays: Example Garbage
Multidimensional Arrays
1) Write a C program using arrays that produces the multiplication of two 2x2 matrices.
3-Dimensional Array
Write a program of your own choice that makes use of arrays of more than 2 dimensions.
2-Dimensional Arrays
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Safalta Digital marketing institute in Noida, provide complete applications that encompass a huge range of virtual advertising and marketing additives, which includes search engine optimization, virtual communication advertising, pay-per-click on marketing, content material advertising, internet analytics, and greater. These university courses are designed for students who possess a comprehensive understanding of virtual marketing strategies and attributes.Safalta Digital Marketing Institute in Noida is a first choice for young individuals or students who are looking to start their careers in the field of digital advertising. The institute gives specialized courses designed and certification.
for beginners, providing thorough training in areas such as SEO, digital communication marketing, and PPC training in Noida. After finishing the program, students receive the certifications recognised by top different universitie, setting a strong foundation for a successful career in digital marketing.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
2. What is Function
Block of code that performs a specific task.
It has a name and it is reusable i.e. it can be executed
from as many different parts in a C Program as required.
Every function has a unique name. This name is used to
call function from “main()” function. A function can be
called from within another function.
It also optionally returns a value to the calling program
Performs a specific task. A task is a distinct job that your
program must perform as a part of its overall operation,
such as adding two or more integer, sorting an array into
numerical order, or calculating a cube root etc.
3. Sample Function Call
#include <stdio.h>
int main ( ) printf is the name of a predefined
{ function in the stdio library
printf (“Hello World!n”) ; this statement is
return 0 ; is known as a
} function call
this is a string we are passing
as an argument (parameter) to
the printf function
4. Function
• The ‘building blocks’ of a C program
▫ You’ve used predefined functions already:
main()
printf(), scanf(), pow()
▫ User-defined functions
Your own code
In combination with predefined functions
5. Sample User-Defined Function
#include <stdio.h>
void printMessage ( void ) ;
int main ( void )
{
printMessage ( ) ;
return 0 ;
}
void printMessage ( void )
{
printf (“A message for you:nn”) ;
printf (“Have a nice day!n”) ;
}
6.
7. Examining printMessage
#include <stdio.h>
void printMessage ( void ) ; function prototype
int main ( void )
{
printMessage ( ) ; function call
return 0 ;
}
void printMessage ( void ) function header
{
printf (“A message for you:nn”) ; function
printf (“Have a nice day!n”) ; body
}
function definition
8. Program example: functions
#include<stdio.h>
kira(int t_semasa, int t_lahir);
main()
{
int t_semasa,t_lahir,u;
printf("Please enter your birth year:");
scanf("%d",&t_lahir);
printf("Please enter the current year:");
scanf("%d",&t_semasa);
u = kira(t_semasa,t_lahir);
printf("nYour age is: %d years oldnn",u);
return 0;
}
kira(int t_semasa, int t_lahir)
{
int umur;
umur = t_semasa-t_lahir;
return(umur);
}
9. Types of functions
Functions with no arguments and no return values.
Functions with arguments and no return values.
Functions with arguments and return values.
Functions that return multiple values.
Functions with no arguments and return values.
10. Functions with no arguments and no
return value
A C function without any
arguments means you cannot
pass data (values like int, char
etc) to the called function.
Similarly, function with no
return type does not pass back
data to the calling function. It is
one of the simplest types of
function in C.
This type of function which
does not return any value
cannot be used in an expression
it can be used only as
independent statement.
11. Program example: Functions with no arguments and no return
value
#include<stdio.h>
cetak_line1();
cetak_line2();
main()
{
printf("Welcome to function in C");
cetak_line1();
printf("Function easy to learn.");
cetak_line1();
printf("Please make sure you really understand about this topic.");
cetak_line2();
return 0;
}
cetak_line1()
{
int i;
printf("n");
for(i=0;i<30;i++)
{
printf("-");
}
printf("n");
return 0;
}
cetak_line2()
{
printf("n--------------------------------------------------------");
return 0;
}
12. Functions with arguments and no
return value
In our previous example what we have
noticed that “main()” function has no
control over the UDF “printfline()”, it
cannot control its output. Whenever
“main()” calls “printline()”, it simply
prints line every time. So the result
remains the same.
A C function with arguments can
perform much better than previous
function type.
This type of function can accept data
from calling function. In other words,
you send data to the called function
from calling function but you cannot
send result data back to the calling
function. Rather, it displays the result
on the terminal. But we can control the
output of function by providing various
values as arguments.
13. Program example: Functions with arguments and no return value
#include<stdio.h>
tambah(int x, int y);
main()
{
int x,y;
printf("Please enter a value x:");
scanf("%d",&x);
printf("Please enter a value y:");
scanf("%d",&y);
tambah(x,y);
return 0;
}
tambah(int x, int y)
{
int result;
result = x+y;
printf("Sum of %d and %d is %d.nn",x,y,result);
return 0;
}
14. Functions with arguments and return
value
This type of function can send
arguments (data) from the
calling function to the called
function and wait for the result to
be returned back from the called
function back to the calling
function.
This type of function is mostly
used in programming world
because it can do two way
communications; it can accept
data as arguments as well as can
send back data as return value.
The data returned by the
function can be used later in our
program for further calculations.
15. Program example: Functions with arguments and return value
#include<stdio.h>
tambah(int x, int y);
main()
{
int x,y,z;
printf("Please enter a value x:");
scanf("%d",&x);
printf("Please enter a value y:");
scanf("%d",&y);
z = tambah(x,y);
printf("Result %d.nn",z);
return 0;
}
tambah(int x, int y)
{
int result;
result = x+y;
return(result);
}
16. Functions with no arguments but
returns value
We may need a function which
does not take any argument but
only returns values to the
calling function then this type
of function is useful. The best
example of this type of function
is “getchar()” library function
which is declared in the header
file “stdio.h”. We can declare a
similar library function of own.
17. Program example: Functions with no arguments but returns value
#include<stdio.h>
send();
main()
{
int z;
z = send();
printf("nYou entered : %d.", z);
return 0;
}
send()
{
int no1;
printf("Enter a no : ");
scanf("%d",&no1);
return(no1);
}
18. Functions that return multiple values
• We have used arguments to send values to the
called function, in the same way we can also use
arguments to send back information to the
calling function.
• The arguments that are used to send back data
are called Output Parameters.
• Is a bit difficult for novice because this type of
function uses pointer.
19. Program example: Functions that return multiple values
#include<stdio.h>
calc(int x, int y, int *add, int *sub);
main()
{
int a,b,p,q;
printf("Please enter a value a:");
scanf("%d",&a);
printf("Please enter a value b:");
scanf("%d",&b);
calc(a,b,&p,&q);
printf("Sum = %d, Sub = %d",p,q);
return 0;
}
calc(int x, int y, int *add, int *sub)
{
*add = x+y;
*sub = x-y;
return (0);
}