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

9y 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?

The file will refuse to open - If you don't have a suitable program already installed, you will get a 'warning' message - asking you if you want to locate the program yourself, or use the internet to find one.


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


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

a window


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


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.