using namespace std ;
Write C++ code to do the followings:
1-Display the multiples of 3 backward from 33 to 3, inclusive.
2-Display the uppercase letters of the alphabet backward from Z to A.
3-Ask the user to enter letters and convert it to uppercase.
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
cout<<"Multiples of 3 backward from 33 to 3,
inclusive are:\n";
for (int i = 33; i >= 3; --i)
{
if(i%3==0)
cout<<i<<endl;
}
return 0;
}
===========================================
Output:
akshay@akshay-Inspiron-3537:~$ g++ three.cpp
akshay@akshay-Inspiron-3537:~$ ./a.out
Multiples of 3 backward from 33 to 3, inclusive are:
33
30
27
24
21
18
15
12
9
6
3
============================================================
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
cout<<"Uppercase letters of the alphabet
backward from Z to A\n";
for (int i = 90; i >= 65; --i)
{
cout<<char(i)<<endl;
}
return 0;
}
============================================================
akshay@akshay-Inspiron-3537:~$ g++ three.cpp
akshay@akshay-Inspiron-3537:~$ ./a.out
Uppercase letters of the alphabet backward from Z to A
Z
Y
X
W
V
U
T
S
R
Q
P
O
N
M
L
K
J
I
H
G
F
E
D
C
B
A
================================================================
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
cout<<"Enter Letter\n";
char ch;
cin>>ch;
if( ch >= 'a' && ch <= 'z')
ch = ch - ('a' - 'A');
cout<<"UpperCase is "<<ch;
return 0;
}
==================================================================
akshay@akshay-Inspiron-3537:~$ g++ three.cpp
akshay@akshay-Inspiron-3537:~$ ./a.out
Enter Letter
a
UpperCase is A
using namespace std ; Write C++ code to do the followings: 1-Display the multiples of 3...
This is a c++ question note: not using namespace std; at the beginning of the program Writing Data to a File This program will write a series of letters, starting with 'A', to an external file (letters.txt). The user will decide how many letters in total get saved to the file. ** IMPORTANT: The test cases will evaluate your code against .txt files that I uploaded. You do NOT have to upload your own txt files. Input: Including 'A', how many...
In this program, you will be using C++ programming constructs, such as overloaded functions. Write a program that requests 3 integers from the user and displays the largest one entered. Your program will then request 3 characters from the user and display the largest character entered. If the user enters a non-alphabetic character, your program will display an error message. You must fill in the body of main() to prompt the user for input, and call the overloaded function showBiggest()...
Write a code to display multiples of 15, from 15 to 1500 using the same code as below using a WHILE loop <!DOCTYPE html> <html> <body> <script> var i=13; while (i<=79) { document.write("The number is ", i); document.write("<br />"); i = i + 2; } </script> </body> </html>
This is a c++ question we are not using namespace std at the top Subtraction + Decision and Loop This is a twist on the previous exercise that will help you review loops and decision structures. You will again ask the user to enter two numbers. However, you will ALWAYS subtract the smaller number from the larger number to ensure that you never get a negative number for an answer. You do this by checking the numbers and switching them...
Convert the below code into if else selection: #include <iostream> using namespace std; int main() { int num; sin. >> num; switch (num) { case 1: cout << "Casel: Value is: << num << endl; break; case 2: break; case 3: cout << "Case3: Value is: " << num << endl; break; default: cout << "Default: Value is: << num << endl; break; } return; }
Q3). Write a C program to compute and display maximum of three numbers using a function for maximum of two numbers. Sample Output: Input: 5153 Maximum = 15 Q4). Write a C program to input a lowercase alphabet character then display it as uppercase character. SAMPLE OUTPUT: Enter any a lowercase character: a Uppercase: A
This is a C++ question we do not use namespace std at the beginning of the program 9. Arrays: Functions and Reading From File Although this code is a little long, the strategy is straightforward and it will really help you practice functions. I have provided a large amount of detail to help you out. In a nutshell, you're going to read some numbers from a file (into an array) and then ask the user for a number that will...
Write a code in C language to do following: 1. display pin input by user in **** form instead of numbers by using ncurses 2. verify the pin by comparing with already stored 2 pins in a text file 3. change text color as per user choice WINDOWS BASED
Write a code in C language to do following: 1. display pin input by user in **** form instead of numbers by using ncurses 2. verify the pin by comparing with already stored 2 pins in a text file 3. change text color as per user choice WINDOWS BASED
Problem 1 This program is about dictionaries. We want to use a dictionary to store frequency count of each letter in a string. Write a Python program to do the following: (a) Ask the user to enter a string. Convert all letters to uppercase. Count the frequency of each letter in the string. Store the frequency counts in a dictionary. You should count letters only. Do not count any other characters such as digits and space. Display the dictionary. (b)...