Advertisement
raju02

Basic of array

Jan 7th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. ///Number 1
  2. #include <stdio.h>
  3. int main()
  4. {
  5. int a[100] , i , n;
  6.  
  7. printf("How many value?:\n");
  8. scanf("%d",&n); /// jotota value nibo ner man o toto
  9.  
  10. for(i = 0; i < n; i++)
  11. {
  12. scanf("%d" ,&a[i]); /// Input nibar jonno loop
  13. }
  14. for(i = 0; i < n; i++)
  15. {
  16. printf("%d %d\n", i, a[i]); /// je index e je value insert hoiche seta print korbe
  17. }
  18.  
  19. }
  20. ///Number 2
  21. #include <stdio.h>
  22. int main()
  23. {
  24. int a[100] ={1 , 2 , 3 , 4 ,5};
  25.  
  26. for(i = 0; i < 5; i ++)
  27. {
  28. printf("%d ",a[i]); /// value ache 5 ta , tai 5 porjonto loop chalaichi
  29.  
  30. }
  31. }
  32. ///Number 3
  33. #include <stdio.h>
  34. int main()
  35. {
  36. int a[100] ={1 , 2 , 3 , 4 ,5};
  37.  
  38. printf("Number of array 2 index = %d\n", a[2]);/// array er 2 number index 3 print korse
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement