Search results

  1. V

    Print the string of structure

    I think this will print the whole string. "Joy" I made program for this #include <stdio.h> int main() { char account.name[10] = "Joy"; printf("Print content of account.name : %s \n", account.name); return 0; } This program doesn't print anything but when I remove dot(.)...
  2. V

    Print the string of structure

    I am really sorry Maybe i do not understand what you want to ask. Can you give me another chance. I will do my best
  3. V

    Print the string of structure

    I have explained with example please look at post #5 see the difference between both code #include<stdio.h> int main (void) { int number[100]= {1,2,3,4,5}; printf("array element : %d \n", number[0]); printf("array element : %d \n", number[1]); printf("array element : %d \n"...
  4. V

    Print the string of structure

    This will not print anything because of %d this is use for numbers and you have initialized string This will store only one number account.name[o]= ?;
  5. V

    Print the string of structure

    printf("Print content of account.name : %d \n", account.name); account.name = 5 This statement will print the content of account.name. so if the account.name = 5 , then this will print 5 printf(" Print content of account.name: %d \n", account.name ) This statement will print the...
  6. V

    Print the string of structure

    Please look at post #5 I understand array in c. I have written program for array in post #5 I know the difference between this two int number[5] = {1,2,3,4,5}; Array storing 5 number's int number[5] = {"12345"}; string of 5 numbers with a null terminator.
  7. V

    Print the string of structure

    This section will print the content of string. char name[4] = "Joy"; ... printf("Name is %s\n",name); This section will not print the string the name of string is wrong, it should name char name[10]; ... printf(" name %s \n",account.name); There is difference between string name [I]
  8. V

    Print the string of structure

    I think I am missing some basics. I am explaining why the loop loop is use to check the size of array and store to array element #include<stdio.h> int main (void) { int number[5]= {1,2,3,4,5}; printf("array element : %d \n", number[0]); printf("array element : %d \n"...
  9. V

    Print the string of structure

    Yes I understand statement and loop in c programming string #include <stdio.h> int main() { char name[4] = "Joy"; printf("Name is %s\n",name); return 0; } Name is Joy length of a string #include <stdio.h> int main() { char name[100], i; printf("Enter a string: ")...
  10. V

    Print the string of structure

    I want to print the string of structure what's the problem in my code. How to print the string of structure #include<stdio.h> struct profile { char name[10]; int number; }; int main() { struct profile account; account.number = 132; account.name[10] = "Joy"; unsigned...
  11. V

    Array in ascending order

    Yes i understand how it works
  12. V

    Array in ascending order

    I followed that link and wrote program in Post #11
  13. V

    Array in ascending order

    I have make it simple #include <stdio.h> int main(void) { int a[10], i, j, n, temp; printf ("\n Pramot user to Enter size: "); scanf ("%d", &n); for (i = 0; i < n; i++) { printf ("\n Enter the element: "); scanf ("%d", &a[i]); }...
  14. V

    Array in ascending order

    Where do you find wrong me in my understanding ? Here loop run 5 times , first it set to 0 than increase by 1 until it get 4 and then stop #include <stdio.h> int main (void) { int N = 5; int i; for (i=0; i < N; i++) { printf ("Number = %d \n",i); } return 0; } Number =...
  15. V

    Array in ascending order

    I was showing you that I understand what is "for (j = 0 ; j <(n-1); j++)" I am stuck in three parts of the for statement. I don't know what is use of them ?
  16. V

    Array in ascending order

    It check the value n-1 value then print the value of j #include <stdio.h> int main() { int j, n; printf("value of n : "); scanf("%d", &n); for (j = 0 ; j <n-1; j++) printf(" j : %d \n",j); return 0; } value of n : 4 j : 0 j : 1 j : 2
  17. V

    Array in ascending order

    Yes I understand use of "for" loop #include <stdio.h> int main (void) { int N = 10; int i; for (i=0; i<N; i++) { printf ("Number %d \n",i); } return 0; } Number 0 Number 1 Number 2 Number 3 Number 4 Number 5 Number 6 Number 7 Number 8 Number 9
  18. V

    Array in ascending order

    Hello I am looking help to understand this program. array in ascending order in C programming #include <stdio.h> int main(void) { int a[20], i = 0, j = 0, n, t; printf ("\n Pramot user to Enter Element: "); scanf ("%d", &n); printf ("\n"); for (i = 0; i < n; i++)...
  19. V

    Program to print a string

    The C compiler automatically add null character '\0' at the end of the string which indicates the end of the string char variable store only one letter and it take 1 byte memory space. one char variable store ASCII value of one character. string is combination of many letters like...
  20. V

    Program to print a string

    we can use loop to store limited value #include <stdio.h> int main() { char Book [11] = {'E','l','e','c','t','r','o','n','i','c','s'}; int i; for (i = 0; i < 11; i++) { printf("Name of Book is = %c \n",Book[i]); }...
Top