This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream.h> | |
| #include <string.h> | |
| class student | |
| { | |
| char *arr[5]; | |
| public: | |
| student(void){ | |
| for(int i=0;i<5;i++){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main(void){ // coded by Zuqurnain jutt | |
| int num=1,den=1,t1=1; | |
| double n=0.25,t2=1; // n can be any number | |
| for(int i=1;;i++){ | |
| t2=i*n; | |
| t1=t2; | |
| t2-=t1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream.h> | |
| double my_sqrt(int,int); | |
| int main() | |
| { | |
| int num,root; // root can be 2,3,4... | |
| //root depends you want to take square , cube , 4rth , 5th , nth root of any number | |
| cout<<"Enter Your Value N :=:"; cin>>num; cout<<"\n"; | |
| if(num<0){ | |
| cout<<"Square Root of -ve entry in real Number is Not Possible\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <string.h> | |
| #include <iostream> | |
| #include <fstream> | |
| using namespace std; | |
| class Permute{ | |
| int start,end,count; | |
| char *f,*str; | |
| public: | |
| Permute(char* st,char* fn){ // fn = file name / full path with name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string.h> | |
| using namespace std; | |
| char* Longpali(char* s){ | |
| char* temp; | |
| int location = 0,j=0; | |
| int maxsize = 0; | |
| for ( int i = 0; i < strlen(s) - 1; i++ ) { | |
| int left = i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string.h> | |
| using namespace std; | |
| char* substring(char* s){ | |
| char* temp; | |
| int location = 0,j=0; | |
| int size = 0; | |
| for ( int i = 1; i < strlen(s) - 1; i++ ) { | |
| int left = i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string> | |
| using namespace std; | |
| int main() { | |
| string s; | |
| cout<<"Enter The String :=:"; getline(cin,s,'\n'); cout<<"\n"; | |
| for(int i=0;s[i]!=0;i++){ | |
| if((s[i]>=48 && s[i]<=57)||(s[i]>=65 && s[i]<=90)||(s[i]>=97 && s[i]<=122)){ | |
| cout<<s[i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| using namespace std; | |
| /* | |
| Reason: when we are doing p[i] it is actually equall to *(p+i) , | |
| similarly when we are doing &p[i] it is equal to (p+i) so giving address, | |
| when we do &((&p[a])[b]) is it equall to (p+a+b) , p=0 so 0+a+b = a+b , | |
| i have used integer type casting because pointer p was of character type | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| #include <fstream> | |
| using namespace std; | |
| int main(){ // By Zulqurnain jutt | |
| int Number,count=0,*Num; | |
| cout<<"Enter Any Integer Number :=:"; cin>>Number; cout<<"\n"; | |
| int temp=1; | |
| bool Negative=0; // if negative |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| using namespace std; | |
| int main(){ // done by Zulqurnain jutt | |
| int Number=13579; | |
| for(int i=Number,j,count=1;i!=0;count=1){ | |
| for(j=i;j!=0;j/=10,count*=10){} | |
| cout<<i<<"\n"; | |
| count/=10; | |
| i%=count; | |
| } |