C++ Program for temperature conversion which converts fahrenheit to celcius or celcius to fahrenheit depending upon user's choice

#include<iostream.h>#include<conio.h> void main(){ clrscr(); //to clear the screen float temp,res; int choice; cout<<“Temperature Conversion”<<“nn   1.Fahrenheit to Celcius”; cout<<“n   2.Celcius to FahrenheitnnEnter your choice:”; cin>>choice; switch(choice){ case 1: {     cout<<“nEnter temperature in Fahrenheit:”;     cin>>temp;     res=(temp-32)/1.8;} break; case 2: {     cout<<“nEnter temperature in Celcius:”;     cin>>temp;     res=(temp*1.8)+32;} break; } cout<<“nConverted Temperature=”<<res; getch(); …

C++ Program for temperature conversion which converts fahrenheit to celcius or celcius to fahrenheit depending upon user's choice Read More »

C++ Program to Print an Alphabet from A to L of *’s in Capital Letter

#include<iostream> using namespace std; int main() { int i,j,k=1; char ch; cout<<“Input an Alphabet in capital letters that you want to print:”; cin>>ch; cout<<“nnnn”; switch(ch) { case ‘A’: cout<<“ttt    “; for(i=1;i<=40;++i) { for(j=0;j<=22;++j) { if(i==1||i==2||i==21||i==20) cout<<“*”; else { if(j==0||j==20) cout<<“**”; else cout<<” “; } } cout<<“nttt    “; } break; case ‘B’: cout<<“tttt”; while(k<=2) { for(i=1;i<=9;++i) …

C++ Program to Print an Alphabet from A to L of *’s in Capital Letter Read More »

C++ Program to Find ASCII value of a character

#include<iostream.h>                #include<conio.h> void main(){ clrscr(); char ch,c; int cha; cout<<“Enter a character:”; cin>>ch; cha=ch; cout<<“nASCII value of “<<ch<<” is “<<cha; c=ch+1; cha=c; cout<<“nAdding one to the character:”<<“nASCII value of “<<c<<” is “<<cha; getch();}