Freedom of Speech and Expression in Malaysia

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

Enter an integer
98
Sum of digits of entered number = 17

#include<stdio.h>
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 %dn”,y); /*display the output of sum y*/ }

Return 0; /*returning*/
}

introduction
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.

Get to Know The Price Estimate For Your Paper
Topic
Number of pages
Email Invalid email

By clicking “Check Writers’ Offers”, you agree to our terms of service and privacy policy. We’ll occasionally send you promo and account related email

"You must agree to out terms of services and privacy policy"
Write my paper

You won’t be charged yet!

SPG0412

NAME:NURUL EKA SHAHFIKA BINTI RAZI
ID:PIC127060
MISS:MISS NURUL RADFIZA BINTI MUHAMAD RASHID

Updated: Jul 06, 2022
Cite this page

Freedom of Speech and Expression in Malaysia. (2016, Apr 02). Retrieved from https://studymoose.com/freedom-of-speech-and-expression-in-malaysia-essay

Freedom of Speech and Expression in Malaysia essay
Live chat  with support 24/7

👋 Hi! I’m your smart assistant Amy!

Don’t know where to start? Type your requirements and I’ll connect you to an academic expert within 3 minutes.

get help with your assignment