Write program which reads a string of 3 letters 0th and 2nd

Write program, which reads a string of 3 letters. 0^th and 2^nd letters are digits. The 1^st digit is +, - * or/. Input 5 + 3 output 8. Input 7*4 output 28. Input 8/3 output 2.67. Read a string and find last letter. Read a string and find number of digits input w3er47ty output 3 This program outputs the second word of a string Input Ram Prasad Kumar Dey. Output Prasad Write a program to print 1:20 in an output tile \"out txt\" Each number in the text file should be in a new line. Write a program that determines whether a given year is a leap year or not. Leap years are years in which February has 29 days Your program will ask the user to enter a year continuously. If the year entered is a leap year, your program will write the year in a txt file \"leapyear.txt\", else the program will write the year in another txt file \"notleapyear.txt\" The user will have the option to exit the program by typing \'-1 \". Each year in the text files should be in a new line. Enter the following numbers to test 2000, 1800, 2008, 1900, 2009, 2013, 2400, 2500

Solution

//C++ code to output 1:20 in new file

#include <iostream>
#include <string.h>
#include <fstream>
#include <iomanip>
#include <cctype>
#include <vector>


using namespace std;


int main()
{  
   ofstream outputFile;
   outputFile.open (\"out.txt\");
  
   int number = 1;
   while(number <= 20)
   {
       outputFile << number;
       outputFile << \"\ \";
       number = number + 1;
   }

   outputFile.close();
return 0;
}

/*
out.txt:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20


*/

 Write program, which reads a string of 3 letters. 0^th and 2^nd letters are digits. The 1^st digit is +, - * or/. Input 5 + 3 output 8. Input 7*4 output 28. In
 Write program, which reads a string of 3 letters. 0^th and 2^nd letters are digits. The 1^st digit is +, - * or/. Input 5 + 3 output 8. Input 7*4 output 28. In

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site