Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Домашнее задание. Понять этот пример.
- #include <stdio.h>
- int nArr[99] = {50, 60, 100, 200, 500, 600, 22};
- ////////////////////////////////////////////////
- int main() //
- {
- printf("size of char = %d\n", sizeof(char));
- for(int i = 0; i < 7; i++)
- {
- printf("nArr[%d] = %3d, ", i, nArr[i] );
- printf("his address = %d\n", &nArr[i] );
- }
- }
- // Домашнее задание. И этот пример понять.
- /*
- #include <stdio.h>
- char sz[99] = "SONY";
- ////////////////////////////////////////////////
- int main() //
- {
- printf("address of sz = %d = %c\n", sz , *sz );
- printf("address of sz[1] = %d = %c\n", &sz[1], sz[1]);
- printf("address of sz[2] = %d = %c\n", &sz[2], sz[2]);
- printf("address of sz[3] = %d = %c\n", &sz[3], sz[3]);
- }
- */
- /*
- #include<stdio.h>
- int main()
- {
- int narr[20];
- int max,min,imax,imin;
- max=0;
- min=0;
- for(int i=0;i<=19;i++)
- {
- printf("narr[%d]= %d \n", i, narr[i] );
- if(narr[i]>max){ max=narr[i]; imax=i;}
- if(narr[i]<min){ min=narr[i];imin=i;}
- }
- printf("imax=%d \n",imax);
- printf("imin=%d \n",imin);
- printf("max= %d \n", max);
- printf("min= %d \n", min);
- }
- #include <stdio.h>
- ////////////////////////////////////////////////
- void Dima(int a, int b) //
- {
- int sum;
- sum = a + b;
- printf("sum = a + b = %d + %d = %d \n" , sum);
- }
- ////////////////////////////////////////////////
- int main() //
- {
- Dima(1, 2);
- }
- */
- /*
- #include<stdio.h>
- ////////////////////////////////////////////////
- void Dima() //
- {
- int a,
- sum,
- b;
- sum = 0;
- a = 10;
- b = 5;
- sum = a + b;
- printf("%d \n" , sum);
- }
- ////////////////////////////////////////////////
- int main() //
- {
- Dima();
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement