Write c-code for 5+55+555+5555+55555+555555+5555555.
Output will be it's answer...

Answer Posted / vinod

main()
{
long int f=0,ans=0;
for(int i=0;i<7;i++)
{
f=f*10+5;
ans+=f;
}
printf("%ld",ans);
}

Is This Answer Correct ?    46 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to execute code even after the program exits the main() function?

801


Why structure is used in c?

577


Dont ansi function prototypes render lint obsolete?

599


What is the significance of c program algorithms?

674


What is the difference between if else and switchstatement

1308






What are the types of pointers?

596


What are identifiers and keywords in c?

562


Describe the order of precedence with regards to operators in C.

628


What is console in c language?

599


how is the examination pattern?

1587


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

1872


to find the closest pair

1816


Explain bitwise shift operators?

623


Function calling procedures? and their differences? Why should one go for Call by Reference?

625


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

725