The document discusses functions in C programming. It defines what a function is and explains why functions are used to avoid duplicating code and make programs easier to design, understand and maintain. It describes the different types of functions like pre-defined and user-defined functions. It also covers function prototypes, parameters, return values, recursion, library functions and pointers.
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.
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
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.
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
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
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
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
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
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.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
2. FUNCTION
A function is a group of statements that together perform
a task. (or) A Function is a sub-program, which
contains one or more statements and it performs some
task when its called.
A computer program cannot handle all the tasks by itself.
Instead its requests other program like entities – called
functions in C to get its task done.
3. Why we use functions?
Writing functions avoids rewriting the same code over and
over.
Suppose that there is a section of code in a program that
calculates area of a circle. If later in the program we want to
calculate the area of a different circle, we wont like to write
the same instructions again.
Instead, we would prefer to jump to a “section of code” that
calculates area and then jump back to the place from where
we left off.
This section of code is nothing but a function.
4. Using functions it becomes easier to write programs and keep
track of what they are doing.
If the operation of a program can be divided in to separate
activities, and each activity placed in a different function, then
each could be written and checked more or less independently.
Separating the code in to modular functions also makes the
pro-gram easier to design and understand.
Why we use functions?
5. TYPES
There are two different types of functions:
Pre-defined functions
User-defined functions
6. Pre-Defined Functions
The pre-defined functions or library functions are
built-in functions.
The user can use the functions, but cannot modify
those functions.
Example: sqrt()
7. User-Defined Functions
The functions defined by the user for their
requirements are called user-defined functions.
Whenever it is needed, the user can modify this
function.
Example: sum(a,b)
8. Advantage of User-Defined Functions
The length of the source program can be reduced.
It is easy to locate errors.
It avoids coding of repeated instructions.
9. Elements of User-Defined Function
Function declaration
Function definition
Function call
#include <stdio.h>
#include<conio.h>
void main()
{
void add(void); //function declaration
add(); //function call
}
void add() // function definition
{
int a,b,c;
printf("nEnter two number:");
scanf("%d%d",&a,&b);
c=a+b;
printf("nSum is:%d",c);
}
11. How Function Works?
Once a function is called the control passes to the called function.
The working of calling function is temporarily stopped.
When the execution of called function is completed then the
control returns back to the calling function and executes the next
statement.
12. Parameters
Actual Parameter
These are the parameters which are transferred from the
calling function to the called function.
Formal Parameter
These are the parameters which are used in the called
function.
Parameter is variable in the declaration of function.
Argument is the actual value of this variable that gets
passed to function.
13.
14. return Statement
The return statement may or may not send some
values to the calling function.
Syntax:
return; (or)
return (expression);
15. Function Prototypes
There are four types:
Function with no arguments and no return values.
Function with arguments and no return values.
Function with arguments and return values.
Function with no arguments and with return values.
Argument is the actual value of the variable that gets
passed to function.
16. Function with no arguments and no return
values
Here no data transfer takes place between the calling
function and the called function.
These functions act independently, i.e. they get input
and display output in the same block.
17.
18. Example
#include <stdio.h>
#include<conio.h>
void main() //calling function
{
void add(void);
add();
}
void add() //called function
{
int a,b,c;
printf("nEnter two number:");
scanf("%d%d",&a,&b);
c=a+b;
printf("nSum is:%d",c);
}
20. Function with arguments and no return values
Here data transfer take place between the calling function
and the called function.
It is a one way data communication, i.e. the called
program receives data from calling program but it does not
return any value to the calling program.
24. Function with arguments
and return values
Here data transfer takes place between the calling
function and the called function.
It is a two way data communication, i.e. the called
program receives data from calling program and it
returns some value to the calling program.
28. Function with no arguments
and with return values
Here data transfer takes place between the called
function and the calling function.
It is a one way data communication, i.e. the called
program does not any receive data from the calling
program but it returns some value to the calling
program.
32. Parameter Passing Methods
There are two different ways of passing parameters to a
method, they are:
Call by value
Call by reference
33. Call by value
Actual arguments are passed to the formal arguments.
Any changes made to the formal argument does not
affect the actual argument.
34. Example-swapping
#include <stdio.h>
#include<conio.h>
void main()
{
int x,y;
int swap(int,int);
printf("nEnter value of x:");
scanf("%d",&x);
printf("nEnter value of y:");
scanf("%d",&y);
swap(x,y);
printf("nnValues in the
Main()-->x=%d,y=%d",x,y);
}
int swap(int a,int b)
{
int c;
c=a;
a=b;
b=c;
printf("nValues in the Fuction -->
x=%d, y=%d",a,b);
}
Output:
35. Call by reference
Instead of passing values, the address of the argument
will be passed.
Any changes made to the formal argument will affect
the actual argument.
36. Example
#include <stdio.h>
#include<conio.h>
void main()
{
int x,y;
int swap(int*,int*);
printf("nEnter value of x:");
scanf("%d",&x);
printf("nEnter value of y:");
scanf("%d",&y);
// address of x and y is passed to the
swap function
swap(&x,&y);
printf("nnValues in the Main-->
x=%d, y=%d",x, y);
}
//pointer a and b points to the address
of x and y respectively.
int swap(int *a, int *b)
{
int c;
c=*a;
*a=*b;
*b=c;
printf("nValues in the Function -->
x=%d,y=%d",*a,*b);
}
output:
Enter value of x:5
Enter value of y:6
Values in the Function -->x=6,y=5
Values in the Main-->x=6,y=5
37.
38. Recursion
It is a process of calling the same function itself again and
again until some condition is satisfied.
Syntax:
func1()
{
………..
func1();
…………
}
39. Example
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
int rec(int);
printf("nEnter the number:");
scanf("%d",&a);
printf("The factorial of %d! is
%d",a,rec(a));
}
int rec(int x)
{
int f;
if(x==1)
return(1);
else
f=x*rec(x-1);
return(f);
}
Output:
Enter the number:5
The factorial of 5! is 120
41. Library Function
Library functions are the pre-defined functions.
The library function provides functions like
mathematical, string manipulation etc,.
In order to use a library function, it is necessary to call
the appropriate header file at the beginning of the
program.
The header file informs the program of the name,
type, and number and type of arguments, of all of the
functions contained in the library in question.
A header file is called via the preprocessor statement.
42. Some Examples of Library
Functions
sqrt(x):
It is used to find the square root of x
Example: sqrt(36) is 6
abs(x):
It is used to find the absolute value of x
Example: abs(-36) is 36
pow(x,y):
It is used to find the value of xy
Example: pow(5,2) is 25
43. ceil(x):
It is used to find the smallest integer greater than or equal to x.
Example: ceil(7.7) is 8
rand():
It is used to generate a random number.
sin(x):
It is used to find the sine value of x
Example: sin(30) is 0.5
cos (x):
It is used to find the cosine value of x
Example: cos(30) is 0.86
44. tan(x):
It is used to find the tan value of x
Example: tan(30) is 0.577
toascii(x):
It is used to find the ASCII value of x
Example: toascii(a) is 97
toupper(x):
It is used to convert lowercase character to uppercase.
Example: toupper(‘a’) is A toupper(97) is A
tolower(x):
It is used to convert uppercase character to lowercase.
Example: tolower(‘A’) is a
46. printf("nThe absolute value of -6 is %d",abs(-6));
printf("nThe value of sin 45 is %f",sin(45));
printf("nThe uppercase of 'a' is %c",toupper('a'));
printf("nThe uppercase of 97 is %c",toupper(97));
getch();
}
47. Output:
Enter the number:6
The square root of 6 is 2.449490
The value of 6 power 2 is 36.000000
The ceiling of 6.7 is 7.000000
The floor of 6.7 is 6.000000
The absolute value of -6 is 6
The value of sin 45 is 0.850904
The uppercase of 'a' is A
The uppercase of 97 is A
49. To Find the length of the string
with user defined function
50. The Towers of Hanoi
A Recursion Application
GIVEN: three poles
a set of discs on the first pole, discs of different sizes, the
smallest discs at the top
GOAL: move all the discs from the left pole to the right one.
CONDITIONS: only one disc may be moved at a time.
A disc can be placed either on an empty pole or on top of a
larger disc.
62. Random number generation using recursion function
#include <stdio.h>
#include <stdlib.h>
int main()
{
void random(void);
int c, n;
printf("Ten random numbers in [1,100]n");
for (c = 1; c <= 10; c++)
{
random();
}
return 0;
}
void random()
{
int n;
n = rand()%100 + 1;
printf("%dn", n);
}
64. Pointers
Pointer is a variable that contains the address of
another variable i.e.. direct address of the memory
location.
Like any variable or constant, you must declare a
pointer before you can use it to store any variable
address.
67. Pointer Declaration
Syntax:
data-type *pointer-name;
data-type - Type of the data to
which the pointer points.
pointer-name - Name of the pointer
Example: int *a;
68. Accessing Variable through Pointer
If a pointer is declared and assigned to a variable, then
the variable can be accessed through the pointer.
Example:
int *a;
x=5;
a=&x;
75. Output:
The Value of a[0] = 2
The Address of a[0] = 6356736
The Value of a[0] = 3
The Address of a[0] = 6356740
The Value of a[0] = 7
The Address of a[0] = 6356744
The Value of b = 6356736
76. Example
#include<stdio.h>
#include<conio.h>
void main()
{
int a=10;
int *b,**c;
b=&a;
c=&b;
printf("n The Value of a = %d",a);
printf("n The Address of a = %u",&a);
printf("n The Value of b = %d",b);
printf("n The Address of b = %u",&b);
printf("n The Value of c = %d",c);
printf("n The Address of c = %u",&c);
}
77. Output
The Value of a = 10
The Address of a = 5001
The Value of b = 5001
The Address of b = 8000
The Value of c = 8000
The Address of c = 9000
78. #include<stdio.h>
#include<conio.h>
void main()
{
int a=10;
int *b,**c;
b=&a;
c=&b;
printf("n The Value of a = %d",a);
printf("n The Address of a = %u",&a);
printf("n The Value of b = %d",b);
printf("n The Address of b = %u",&b);
printf("n The Value of c = %d",c);
printf("n The Address of c = %u",&c);
printf("n The value of b = %d",*b);
printf("n The value of c = %d",*c);
printf("n The value c = %d",**c);
}
output:
The Value of a = 10
The Address of a = 6356748
The Value of b = 6356748
The Address of b = 6356744
The Value of c = 6356744
The Address of c = 6356740
The Address of b = 10
The Address of c = 6356748
The Address of c = 10
79. Output:
The Value of a = 10
The Address of a = 6356748
The Value of b = 6356748
The Address of b = 6356744
The Value of c = 6356744
The Address of c = 6356740
The Address of b = 10
The Address of c = 6356748
The Address of c = 10
80. Pointers and Arrays
The elements of the array can also be accessed through
a pointer.
Example
int a[3]={2,3,7};
int *b;
b=a;
82. Illustration of the example:
8744 2
9000
b a[0]
8744
Variable
Value
Address
83. Output
The Value of a[0] = 2
The Address of a[0] = 8744
The Value of b = 8744
84. #include<stdio.h>
#include<conio.h>
void main()
{
int a[3]={2,3,7};
int *b;
b=&a;
printf("n The Value of a[0] = %d",a[0]);
printf("n The Address of a[0] = %u",&a[0]);
printf("n The Value of a[0] = %d",a[1]);
printf("n The Address of a[0] = %u",&a[1]);
printf("n The Value of a[0] = %d",a[2]);
printf("n The Address of a[0] = %u",&a[2]);
printf("n The Value of b = %d",b);
}
85. Output:
The Value of a[0] = 2
The Address of a[0] = 6356736
The Value of a[0] = 3
The Address of a[0] = 6356740
The Value of a[0] = 7
The Address of a[0] = 6356744
The Value of b = 6356736
87. Illustration of the example:
2 3 7 9 10
a[0] a[1] a[2] a[3] a[4]
8724 8726 8728 8730 8732
Array
Value
Address
88. Output
The Value of a[0] = 2
The Address of a[0] = 8724
The Value of a[1] = 3
The Address of a[1] = 8726
The Value of a[2] = 7
The Address of a[2] = 8728
The Value of a[3] = 9
The Address of a[3] = 8730
The Value of a[4] = 10
The Address of a[4] = 8732