c++ basic question
#include <iostream>
using namespace std;
int main(){
/*
Q- Write a program where the user is asked to enter two integers ( divisor and dividend)
and the quotient and the remainder of their divison is computed . ( Both divisor and dividend should be integers).
int dividend, divisor, quotient , remainder;
cout<<"Enter your dividend : ";
cin>>dividend;
cout<<"Enter your divisor : ";
cin>>divisor;
quotient = dividend/divisor;
remainder = dividend%divisor;
cout<<"The quotient is : "<<quotient<<endl <<"The remainder is : "<<remainder<<endl ;
// Write a program to find size of int , float, double , and char in your computer ?
cout<<"The size of given data types are as follows :"<<endl;
cout<<"size of int : "<< sizeof(int) <<" byte"<<endl;
cout<<"size of float : "<< sizeof(float) <<" byte"<<endl;
cout<<"size of double : "<< sizeof(double) <<" byte"<<endl;
cout<<"size of char : "<< sizeof(char) <<" byte"<<endl;
//Q- write a program to find the ASCII value of any character ?
char c;
cout<<"Enter yout character : ";
cin>>c;
cout<<"the ASCII value of c is : " << int(c) <<endl; */
return 0;
}
Comments
Post a Comment