#include<conio.h> #include<iostream.h> void main(){ int num; clrscr(); cout<<"Rule 1:\n 0 € E"; cout<<"Rule 2:\nIf X € E then \n X+2 € E"; cout<<"No Element allowd to be in O if it cant be proved by using above two rules."; cout<<"Enter number:"; cin>>num; int step=0; int k; if(num%2!=0){ cout<<"Not a Even number"; return;} for(k=0;k<num;k+=2){ cout<<"Step No. "<<++step<<endl; cout<<"Take X="<<k<<"€ E"; if(step==1) cout<<"Given in rules"<<endl; cout<<"Proved by step "<<step-1<<endl; cout<<"X+2=>"<<k<<"+2"<<"="<<k+2<<endl; cout<<"Thus\t"<<k+2<<"€ E"<<endl; } getch(); return ; }
Home
»
Autometa
»
c++
»
Code
»
cpp
»
Even
»
number
»
polymonial
»
prove
» Autometa.... Prove Number is Even
Subscribe to:
Post Comments (Atom)
Post a Comment