iOS training------My C language notes, look forward to communicating with you!
#include <stdio.h>/*1. Variable type variable name; int score; 2. Assignment of variables score = 100; Score = A; Score = b = 100; 3. The output of the variable int a = 200; printf ("%i", a); Common format characters: 1>%d\%i integer (int) 2>%f decimal (float, double) 3>%c character (char)*/intMain () {/*int score; Assignment operation (initialization) score = 1000; Score = 10000; char c; c = ' A '; int a = 20; int d,e,f; int b; b = A = 40; b = +;*/ //variables: As long as there is indeterminate data, you should define the variables to save intScore =205; //1:15 intTime = the; intBestscore =3161; //%d\%i is a format character (placeholder) and can only output integersprintf"score is%d\n", score); //score points are 205 floatHeight =1.78f; //%f used to output decimals, default is 6 decimal placesprintf"height is%.2f\n", height); //height is 1.75//%.2f output retains two decimal places CharScoregrade ='D'; printf ("The integration level is%c\n", Scoregrade); //The integration level is Dprintf"score is%d, height is%f, rank is%c\n", score, height,'C'); //The score is 205, the height is 1.780000, the grade is C. return 0;}
"Good Programmer's note sharing" C language variables