38. Explanation a and x are referring to same location. So value will be over written. Thursday, September 1, 2011
39.
Notes de l'éditeur
We can also declare and define a variable in single shot like this. int a=10;
Format specifiers %d is the format specifier. This informs to the compiler that the incoming value is an integer value. Other data types can be specified as follows: %c – character %f – float %lf – double %s – character array (string) Printf and scanf are defined under the header file stdio.h
While – Entry controlled loop Do While – Exit controlled loop
Header file to be included is string.h
Header file to be included math.h
For assigning more values we need to create an array of structure element like this Struct Person { Int id; Char name[5]; }P[10]; P[0].id = 1; P[0].name = “saran”; P[1].id = 2; P[1].name = “arya”; And so on till P[9]
typedef struct student { int id; Char name[10]; }s; Now I can put s s1,s2; Instead of struct student s1,s2; //In case typedef is missed in struct definition as below struct student { int id; char name[10]; };