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
- 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.
- Now the words are ready placed in arrays. Read each length of array.
- Compare each array length.
- Sort them according to increasing or decreasing order.
- 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