Aug 22, 2017 at 7:17am UTC
asaalam o alaikum frndzz..
what is the c program for first n natural numbers???
Last edited on Aug 22, 2017 at 7:29am UTC
Aug 22, 2017 at 7:27am UTC
i just want a help and how know about it.
Aug 22, 2017 at 7:50am UTC
No, you want someone to do your work for you. Put some effort in to it. Your problem is about as easy as it gets, right there with "Hello world!"
Thomas1965 already gave an excellent answer to your question:
Hint: google around "natural numbers" and "c++ for loop".
When you get stuck, post what you've done and then we'll be happy to help you figure out where you're going wrong with your code. (So far, you've gone wrong with asking the [edit]wrong[/edit] question.)
Hope this helps.
Last edited on Aug 22, 2017 at 10:15am UTC
Aug 22, 2017 at 8:01am UTC
i have done it by my own effort
Aug 22, 2017 at 10:17am UTC
Glad you got it!
Loops are one of the most important control constructs you'll learn. A for-loop is ubiquitous in C++.
When you really get stuck, because something about a problem or the way C++ works doesn't make sense, please feel free to ask more questions.