Haven't found the Essay You Want?
For Only $12.90/page

Freedom of Speech and Expression in Malaysia Essay

Write a program to add of number in c programming. The output of the program should be like the figure below: Enter an integer
Sum of digits of entered number = 17

Enter an integer
Sum of digits of entered number = 17

Int main ( )
Int a,b; /*variable declaration*/
Printf(“insert your integer number \n”); /*insert the integer number that is 98*/
Scanf(“%d”,&a); /* the input percent d,mpersand sign and variablename */

Int y=17; /*assigning the variable value that is yis equal to 17*/

While(y<=17); /*y is is less then or equal to 17*/
Printf(“the sum is %d\n”,y); /*display the output of sum y*/ }

Return 0; /*returning*/

loop structure

loop is know as a group of instruction be executed repeatedly, until a logical condition has been satisfied. looping statements are used to
control program flow. There are three major loop statements in the C programming language.

3 major loop :
* for loop
* while loop
* do…while loop

For loop.

For loop is the fundamental looping statement in C. It is often used for situations in which you want to execute a specific task number of times.

While loop

In the while loop, the body of the loop is executed as long as the expression is true. And when the expression become false, program control passes to the line that follows the loop.

Do.. while loop

This loop structure is similar to the while loop. The do while loop checks its condition at the end of the loop. This means that the do while loop will always excute atleast once.



Essay Topics:

Sorry, but copying text is forbidden on this website. If you need this or any other sample, we can send it to you via email. Please, specify your valid email address

We can't stand spam as much as you do No, thanks. I prefer suffering on my own

Courtney from Study Moose

Hi there, would you like to get such a paper? How about receiving a customized one? Check it out