Anúncio
1st test-  display your name  display numbers 1 to 1000  ask for name.docx
1st test-  display your name  display numbers 1 to 1000  ask for name.docx
1st test-  display your name  display numbers 1 to 1000  ask for name.docx
Próximos SlideShares
2) Indicate how the income and expenses for the activity below are inc.docx2) Indicate how the income and expenses for the activity below are inc.docx
Carregando em ... 3
1 de 3
Anúncio

Mais conteúdo relacionado

Mais de lcarolyn(20)

Último(20)

Anúncio

1st test- display your name display numbers 1 to 1000 ask for name.docx

  1. 1st test: display your name display numbers 1 to 1000 ask for name and age, display name and age last year ask for number, tell whether odd or even ask for real number, display rounded off value to two digits ask for two real numbers, display the product ask for two strings, tell if they are the same (see strings.h strcmp) write your name onto a new file make function isEven(int) which will return true if argument is even otherwise false ask for 10 numbers, display only the even numbers 2nd test print your name in the center of the line fill the screen with your initials ask for two real numbers and display their sum ask for the hour of the day (24 format) and greet good (morning, noon, afternoon, evening, night) ask for name, print it in the middle of the line ask for a digit (0-9) and print the english word ask for two strings, tell if they are the same (ignoring case) (see strings.h library) write your name in name.txt and your address in address.txt make an isPrime (int) function ask for 10 real numbers, sort them, print them Solution 1. display your name= string name; cout<<" enter the name"; cin>> name; cout<<name; 2.diplay numbers from 1 to 1000 for(int i=0;i<1000;i++) cout<<i; 3. string name; int age;
  2. cout<<" enter name and age"; cin>>name>>age; cout<<name<<age; 4.ask for a number to tell even or odd int n; cin>>n; if(n%2==0) cout<<" even number"; else cout<<"odd number"; 5. 7.compare 2 strings: 8. 9. void iseven(int p) { if (p%2==) cout<<" even"; else cout<<"odd"; }}
Anúncio