English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

1. algorithm that will accept a year and determine whether it is a leap year or not

2. Algorithm that will implement the sample below.

Enter your name : Chel
Chel
Chel
Chel
Chel
Chel


3. Algorithm that will compuiter the sum of numbers from 0 up to 100.

4. Algorithm that will allow the user to input name and 5 quizzes. Computer and output the quiz and average.

2006-07-07 19:57:13 · 4 answers · asked by chechel 1 in Computers & Internet Programming & Design

4 answers

i don't know much about algorithm.. so i just used c++

1. i don't know what is leap year ?

2.
cin << name;
for( x=1; x<=5 ; x++ )
{
cout << name << endl;
}

3.
int sum = 0;
for( x=0; x<=100; x++ )
{
sum = sum + x;
}

4. well i don't quite understand the question. the user input the quizzes ???

2006-07-07 20:06:04 · answer #1 · answered by Anonymous · 0 0

2.

int main()
{
char enter, name[80]{};
cout << "Enter your name: ";
cin.getline(name, 79);
for(int x = 0; x < 5; x++)
cout << name"\n";
cin.get(enter);
return 0;
}

3.

for(int x = 0; x <= 100; x++)
{
static int total = 0;
total += x;
}

2006-07-08 03:19:42 · answer #2 · answered by chunky monkey 2 · 0 0

/*here is a c prog for ur 1st question:*/
#include
main()
{
int year;
printf("Enter a year");
scanf("%d",year);
if((year%4==0&&year%100!=0)||(year%100==0&&year%400==0)
printf("the year is leapyear);
else
printf("The year is not leapyear")
}

2006-07-08 04:30:28 · answer #3 · answered by delta d 1 · 0 0

Do your own homework.

2006-07-08 03:50:22 · answer #4 · answered by Gizmo L 4 · 1 0

fedest.com, questions and answers