Thursday, 15 November 2018

C++ Programming Logics

Variable - Integer and String
#include <iostream>
#include <string>
using namespace std;
int main(){
int num,len;
string str;
cout<<"Enter the Value";
cin>>num;
cout<<"Enter the Character";
cin>>str;
cout<<"\n" << num <<"\n"<< str;
}



Leap Year

#include <iostream>
using namespace std;
int main(){
int num;
cout << "Enter a year";
cin >> num;
if((num % 4) == 0 || (num % 100)==0 || (num%400) ==0 ){
cout <<num <<"is a Leap year";
}
else{
cout <<num <<"is not a Leap year";
}
return 0;
}


No comments:

Post a Comment

Troubleshooting in SQL

1. SSRS Error  Round () need to be done in  SQL itself  2. Default Date In SSRS  Start Date =CDate(Format(DateAdd("d",-50,Now()), ...