#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
// simple program using y - n char's yesNO - could be what you want though.
int main()
{
char yesNO;
cout << "Are you an illegal immigrant? y - n: ";
cin >> yesNO;
if (yesNO=='y'
{
cout << "OMG - your an illegal immigrant... calling the police";
return 0;
}
if (yesNO=='n'
{
cout << "Good Your a Fine Civilian ";
return 0;
}
if (yesNO < 'n', 'y'
{
cout << "Closing...";
return 0;
}
}
// Coverterbetterwork.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main() (
float ctemp, ftemp;
cout << "Input a temperature in Celcius and Press ENTER:";
cin >> ctemp;
ftemp = (ctemp * 1. + 32;
cout<< end1;
cout<< "The Fahrenheit Temperature is: " << ftemp;
cout<< end1;
cout<< end1;
system ("pause");
}
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
// simple program using y - n char's yesNO - could be what you want though.
int main()
{
char yesNO;
cout << "Are you an illegal immigrant? y - n: ";
cin >> yesNO;
if (yesNO=='y'
{
cout << "OMG - your an illegal immigrant... calling the police";
return 0;
}
if (yesNO=='n'
{
cout << "Good Your a Fine Civilian ";
return 0;
}
if (yesNO < 'n', 'y'
{
cout << "Closing...";
return 0;
}
}
if (yesNO=="y" || yesNO == "Y" || yesNO == "Yes" || yesNO == "YES" )
{
cout << "OMG - your an illegal immigrant... calling the police";
return 0;
}
if (yesNO=="y" || yesNO == "Y" || yesNO == "Yes" || yesNO == "YES" )
{
cout << "OMG - your an illegal immigrant... calling the police";
return 0;
}
#include <conio.h>
input = "yes";
if(toupper(input) == "YES" || toupper(input) == "Y")
toupper converts a string to capitals.
// Coverterbetterwork.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main() (
float ctemp, ftemp;
cout << "Input a temperature in Celcius and Press ENTER:";
cin >> ctemp;
ftemp = (ctemp * 1. + 32;
cout<< end1;
cout<< "The Fahrenheit Temperature is: " << ftemp;
cout<< end1;
cout<< end1;
system ("pause");
}
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
#include <conio.h>
input = "yes";
if(toupper(input) == "YES" || toupper(input) == "Y")
toupper converts a string to capitals.
Copyright © 2024, NextGenUpdate.
All Rights Reserved.