Example of C language program for calculating Pi

Code:# IncludeLong a = 10000, B, c = 2800, d, e, f [2801], g;Main (){For (; B-c ;)F [B ++] = a/5;For (; d = 0, g = c * 2; c-= 14, printf (%. 4d, e + d/a), e = d %)For (B = c; d + = f [B] * a, f [B] = d % -- g, d/= g --, -- B; d * = B );}The output

Structure and byte alignment in C Language

Struct Struct Concept ★Computer programming languages all have the concept of data types. ★Data types include basic and user-defined types. ★In C, the basic types include int, double, and char. ★The struct type belongs to the User-Defined type and

Implementation of String Array definition in C Language

Method 1: Use a pointer array: # Include # Include # Include Int main (){Char * test [] = {"this is a test", "test 2 ",""};Int I = 0;While (strcmp (test [I], "")! = 0)Puts (test [I ++]);System ("PAUSE ");Return 0;} This method is relatively simple,

Number of super-long digits processed

  Float and double data types are single-precision and double-precision data types. Their values are respectively from the negative power of 3.4E + 10 to the 38 power of 3.4E + 10, and the negative 308 power of 1.7E + 10 to the 308 power of 1.7E + 10

Beej's Guide Network to Programming series serialization 17

5.10. getpeername () --- who are you?This function is too simple. It's so simple that I don't even want to list a single chapter. But I did. The getpeername () function tells you who is on the other side of the connected streaming socket. The

The LISTARRAY function in VC ++ is implemented in C Language (1)

1. # ifndef _ LISTARRAY_H __2. # define _ LISTARRAY_H __3. # include "rtthread. h"4. # include "finsh. h"5. // LIST Array6. typedef struct _ ListArray;7. struct _ ListArray8 .{9. void ** pListPointArray; // LIST array pointer10. int Total; // number

Sqrt Function Analysis

We usually have some data operation operations and need to call sqrt, exp, abs and other functions. Have you ever thought about how these function systems are implemented? Take the most common sqrt function as an example. How can the system

Concepts and differences between the C/S architecture and the B/S architecture

C/S architectureThe C/S architecture is a typical two-layer architecture. The entire process is Client/Server, that is, the Client Server architecture, the client contains one or more programs running on the user's computer, and there are two types

[Slackware] Build Broadcom 802.11 Linux STA driver

Today, when I build Broadcom 802.11 Linux STA driver, there is a error: src/wl/sys/wl_linux.c: 388: 2: error: unknown field 'ndo _ set_multicast_list 'specified in initializer then I google this question and find its answer. 1 vim

Question: Create an array of 20 characters, containing the first 20 items of the Fibonacci series

Print? /* Start the comments in the program header (to avoid any problems encountered during the submission of blog posts, the slash used to indicate that the comments have been deleted)* Copyright and version Declaration of the program* All rights

1009. Speak the opposite language. 1009. Speak the opposite language.

1009. Speak the opposite language. 1009. Speak the opposite language. 1/* 2 * Main. c 3*1009. 4 * Created on: August 29, 2014*6*6*7 */8 9 # include 10 # include 11 12 char inStr [81]; 13 char outStr [41] [81]; 14 15 int main (void) {16 17 int I, j;

Loop-10. Calculate the sum of the First N items of the sequence,-10

Loop-10. Calculate the sum of the First N items of the sequence,-10 1/* 2 * Main. c 3 * C10-loop-10. evaluate the N items before the sequence and 4 * Created on: July 30, 2014 5 * Author: in the Boomkeeper 6 ******** section, ******** 7 */8 9 #

Dynamic pointer array using C language Dynamic arrays

Dynamic pointer array using C language Dynamic arrays The C language implements dynamic arrays. Basic principle: Prepare an array with a fixed length in advance. If the length is not enough, realloc is a region. In addition, the length of the array

Loop-07. Crawling worms, loop-07 crawling worms

Loop-07. Crawling worms, loop-07 crawling worms 1/* 2 * Main. c 3 * C7-cycle-07. crawling worm 4 * Created on: July 26, 2014 5 * Author: Boomkeeper 6 ***** passed the test ********* 7 */8 9 # include 10 11 int main (void) {12 int n, u, d; //

1057: Counterfeit Currency

1057: Counterfeit Currency Time limit (Common/Java): 1000 MS/10000 MS  Running memory limit: 65536 KByteTotal submissions: 2844    Tested: 773 Description There are counterfeit coins !!!This is the case. Now, pork has risen, but the wages of farmers

& Address operators in C Language

Example 1 # Include int find (int * a); main () {int B = 1; int wait, test; test = find (& B); printf ("the memory address is: % d ", & test); scanf (" % d ", & wait) ;}int find (int * a) {return * ;} Int B = 1; int test = find (& B); in this way,

Create a system tray icon using Win32 API

System pallets are common in our programs. Here is a good example. Using Win32 API is helpful for understanding system pallets. # Include # define IDR_PAUSE 12 # define IDR_START 13/* # include # pragma comment (lib, "shell32.lib") */LPCTSTR

Classic operating system problems-read/write problems (Reader preferred)

Problem: Some readers and writers read and write the same blackboard. Multiple readers can read the blackboard at the same time, but only one writer can at a time. Readers cannot use the blackboard at the same time. Different requirements on

Qt learning path (18): QInputDialog In the Qt standard dialog box

This is the last part of the Qt standard dialog box. As shown in its name, QInputDialog is used to receive user input. QInputDialog provides some simple static functions to quickly create a dialog box, just as QColorDialog provides the getColor

Use odbc to read and write excel files: (1) header files

1 # ifndef _ ODBCEXCEL_H2 # define _ ODBCEXCEL_H34 /************************************** **************************************** *******************5 @ brief odbc c ++ class for reading and writing Excel6 * Author qinqing7 * Date 2009-10-318 *

Total Pages: 275 1 .... 50 51 52 53 54 .... 275 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.