Posts

Showing posts from October, 2022

c++ practice session

  #include <iostream> //#include<bits/stdc++.h> #include <iomanip> using namespace std ; int main (){ /* char character ; cout<<"Enter Your character : "; cin>>character; if(character>='a' && character<='z'){ cout<<"This is small case.;"<<endl; } else if(character>='A' && character<='Z' ){ cout<<"This is upper case."<<endl; } else if(character>='1' && character <='9'){ cout<<"This is digit."<<endl; } // Find the sum of even numbers upto n ; int n; cin>>n; int sum=0; for (int i = 0; i <=n; i++) { if(i%2==0){ sum=sum+i; } } cout<<"sum is : "<<sum<<endl; // write a program to find the entered number is prime or not ; // write a program to test weat...