Current location - Training Enrollment Network - Mathematics courses - Basic mathematical function source code
Basic mathematical function source code
Write a program and define the factorial function fact(n) as follows:

# includeintfact (int n) {if (n = = 0 || n = =1) returns1; Otherwise, return n * fac (n-1); }int main(){int m, n, sumprintf ("Please enter m, n \ n"); scanf("%d%d ",& ampm & amp; n); If (n.

Data expansion:

The process of editing a program to make the computer execute is called programming, and many softwares can be programmed. Representative computer languages are Java, BASIC? C, C++, VB, VF, SQL, JSP, ASP, PHP, the software is eclipse, Microsoft Visual Studio, Microsoft? Visual Basic, Microsoft SQL Server and so on.

Java is one of the most widely used programming languages. C language is often used as an introductory language in universities, and BASIC is a beginner &; #39; The abbreviation of general symbol instruction code is a high-level computer language widely used in the world.

Event driven programming

Visual Basic allows you to create programs that reflect user actions and system events. This kind of programming is called event-driven programming. To understand how event drivers work, we must first understand how past programs work and how they are different in the Windows environment.

Before the advent of Windows (back to DOS and "prehistoric" PC), programs were run in sequence. In other words, once the program is started, it will execute one instruction at a time until the program ends or a fatal error occurs.

object-oriented programming

The key technology to make it easier to create Windows programs is object-oriented programming, or OOP. This technology can create reusable components, which are the building blocks of programs.