C++
- Get link
- X
- Other Apps
Traveled_Day_And_Week
#include<iostream>
using namespace std;
const int DAY_IN_A_WEEK = 7;
int main(){
int dayTraveled;
int fullweeks,remainingDayas;
cout<<"plase Enter number of day you travels : "<<endl;
cin>>dayTraveled;
fullweeks = dayTraveled / DAY_IN_A_WEEK;
remainingDayas = dayTraveled % DAY_IN_A_WEEK;
cout<<dayTraveled<<" days and "<<fullweeks<<
" weeks and "<<remainingDayas<<" days "<<endl;
return 0;
}
Popular posts from this blog
Kotlin
C++
C++ is a general purpose programming language and widely used now a days for competitive programming. It has imperative, object-oriented and generic programming features. C++ runs on lots of platform like Windows, Linux, Unix, Mac etc. C++ is a popular programming language. C++ is used to create computer programs. Example #include <iostream> using namespace std; int main() { cout << "Hello World!" ; return 0 ; }
Data Type in C++.
C++ All data type in C++ are here.. #include<iostream> using namespace std; int main() { cout << "Size of char : " << sizeof(char) << " byte" << endl; cout << "Size of int : " << sizeof(int) << " bytes" << endl; cout << "Size of short int : " << sizeof(short int) << " bytes" << endl; cout << "Size of long int : " << sizeof(long int) << " bytes" << endl; cout << "Size of signed long int : " << sizeof(signed long int) << " bytes" << endl; cout << "Size of unsigned long int : " << sizeof(unsigned long int) << " bytes" << endl; cout << "Size of float : " << sizeof(float)...
Comments
Post a Comment