0
Write a program to print the sum of n natural numbers
5 Réponses
+ 5
RANJEET KUMAR VERMA ,
To print the sum of n natural numbers, you will need use a `for loop` or a `while loop`.
You need to learn again lessons...
#introduction to c++
https://www.sololearn.com/learn/courses/c-plus-plus-introduction
#For loop
https://www.sololearn.com/learn/o-CPlusPlus/1616/?ref=app
#while loop
https://www.sololearn.com/learn/o-CPlusPlus/1617/?ref=app
First try by yourself, after this if you face any problems during learning or making code ask again here...
+ 2
RANJEET KUMAR VERMA It is not a place to provide readymade code. First try what you want to do yourself, then if you get stuck, ask here with your code. First of all you have to try it yourself then presenting here the issues you are facing hopefully everyone will help you with correct answers.
0
But which loops are needed to create it
0
RANJEET KUMAR VERMA it not chatGpt , it sololearn discussion section where you can ask doubt and problems you faced while making codes , so first try it by yourself and if you face any problem you can ask
0
RANJEET KUMAR VERMA you can make it through any type of loop!
loops in c++ :-
i) for loop
ii) while loop
iii) do-while loop