-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogram2abackup.c
58 lines (37 loc) · 1.14 KB
/
program2abackup.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Luciano Scarpaci January 7th 2021
* This is programming assignment 2
*
*/
#define _CRT_SECURE_NO_WARNINGS //for Visual Studio compiler
#pragma warning(disable:6031) //ignore scanf warnings
#include<stdio.h> //for input and output
#include<ctype.h> //to change letters to upper and lowercase
#include<stdlib.h> //for absolute value function
#include<math.h> //for power function
//greet the user
void Greeting();
//ask, get, and return an initial
char GetInitial();
//ask, get, and return a double
double GetDouble();
//greeting the user
void Greeting();
{
printf("\nHello, User. Welcome to program 2! ");
}
int main()
{
//declare variables to store the data
int lowNum, upperNum;
char initial, lowInitial, upperInitial;
//Greet the user
printf("\nHello User, Welcome to program 2!);
//Ask the user to enter their first initial
printf("\nEnter an initial: ");
//get the first initial
scanf(" %c", &initial);
lowInitial = tolower(initial); //Change the initial to lowercase
lowNum = (int)lowInitial; //get the numerical value (ASCII)
return 0;
}