1,076,494 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Posts by phani1092 which have been Voted Up

    #include<stdio.h>
    #include<stdlib.h>
    void main()
    {
    int ben[20],c=0;
        printf("pls enter 20 no\n");
    for (int i=0; i<20; i++)
    {
     scanf("%d",&ben[i]);
     c=c+ben[i];
    }
    printf("total:%d",c);
    system("pause");
    }

you would get the desired output :)

phani1092
Newbie Poster
19 posts since Oct 2010
Reputation Points: 10
Solved Threads: 3
Skill Endorsements: 0

Dude, reading a string by length would be much easier. The steps goes this way

  1. Read the length of each word. For every word there will be space compare the string with the space if space found store the word in an array.
  2. Now the words are ready placed in arrays. Read each length of array.
  3. Compare each array length.
  4. Sort them according to increasing or decreasing order.
  5. Print the values of last three or first three depending on the order you give.
phani1092
Newbie Poster
19 posts since Oct 2010
Reputation Points: 10
Solved Threads: 3
Skill Endorsements: 0
 
© 2013 DaniWeb® LLC
Page rendered in 0.0649 seconds using 2.46MB