answersLogoWhite

0


Best Answer

#!/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

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a shell program that adds the integers 1 to 100 and displays the result with a suitable message?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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)


What might happen if you try to open a file that which was created with a program that is not installed on my computer?

If you try to open a file created with a program not installed on your computer, you may encounter an error stating that the file format is not supported. The file may not open properly or may show as corrupted. To open the file successfully, you'll need to install the program used to create it or use a compatible program that supports the file format.


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 displays the name of the document and the name of the program?

title bar


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

A screen (VDU).


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


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


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


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.