answersLogoWhite

0

#!/bin/bash

s=0
c=1
while [$c-le 100]
do
s='expr $s + $c'
c='expr $c + 1'
done
echo "Sum of 1 to 100 is $s"

User Avatar

Wiki User

11y ago

What else can I help you with?

Continue Learning about Math & Arithmetic

What is a rectangular box that displays information or a program?

A screen (VDU).


Write a shell program that Adds the integers 1 to 100 and dislay a message?

SUM = 0: FOR N = 1 to 100: SUM = SUM + N: Next N: PRINT CHR$(11); "Sum ="; SUM: END


What is the flowchart and pseudocode for a program that accept and displays the factorial of a number?

A flowchart for a program that accepts and displays the factorial of a number would include the following steps: Start, Input the number, Initialize a variable for the factorial, Use a loop to calculate the factorial by multiplying the variable by each integer up to the number, Output the result, and End. Pseudocode for the same program would look like this: START INPUT number factorial = 1 FOR i FROM 1 TO number DO factorial = factorial * i END FOR OUTPUT factorial END


When you start up your laptop you get the Microsoft visual c plus plus runtime library error message?

Some program that runs at startup is faulting or is not properly installed. To block programs in the run menu startup folder, hold the left shift key down during login. If this does not work, try to selectively disable program with the msconfig program. You might also be able to find the error log message from the program by running eventvwr.msc. Once you find the offending program, try to reinstall it or contact the manufacturer for help.


How can I write a program to display prime numbers from 1 to 100?

Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.

Related Questions

Write a program in C for arithmetic operations between two integers your program should guide users with proper message or menu on the console?

Write a program in C for showing working of different logical operator in C.Your program should guide users with proper message/menu on the console. (5 Marks)


Which software program displays advertising on your computer?

youtube


C program that displays integers 1 TO 9?

#include <cstdio> int main() { int x = 1; while(x < 10) { printf("%d ", x); x++; } char wait; scanf("%s", wait); return 0; }


What is a rectangular box that displays information or a program?

A screen (VDU).


What displays the name of the document and the name of the program?

title bar


Write a c program which displays digital watch on the screen after taking the hours and minutes from the user?

Write a program which displays digital watch on the screen, after taking the hours and minutes from the user.


Writes a c program to find the sum of all integers between 1 and n?

Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11


When you get the message this program is not responding what does that mean and what causes it to do that?

the program is not working


What is the rectangular box that displays information or a program on windows 7?

a window


Write a shell program that Adds the integers 1 to 100 and dislay a message?

SUM = 0: FOR N = 1 to 100: SUM = SUM + N: Next N: PRINT CHR$(11); "Sum ="; SUM: END


How can one assign a list of integers in Java?

Put statements at the start of ones code will allow one to have a list of integers in their Java program. If one does this then they will successfully have integers in their code.


How do you reverse of the answer program integers in C programming?

sense question Your makes no.