This file contains 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<cmath> | |
using namespace std; | |
int decimal_binary(int n) /* Function to convert decimal to binary.*/ | |
{ | |
int rem, i = 1, binary = 0; | |
while (n != 0) | |
{ |
This file contains 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; | |
bool isNameValid(string name){ | |
int length = name.length(); // name.size() ; strlen(name.c_str); | |
if (length > 40 || length < 5) | |
return false; | |
else |
This file contains 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 fact(int x){ | |
if(x == 0) return 1 ; | |
return x * fact(x-1); | |
} | |
int main(){ | |
int n ; |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/* run this program using the console pauser or add your own getch, system("pause") or input loop */ | |
int main(int argc, char *argv[]) { | |
int counter = 1 ; | |
char fname[50] , lname[50] , address[100] , shenasname[20]; | |
float weight , height , w_sum = 0, h_sum = 0; |
This file contains 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<cmath> | |
using namespace std ; | |
double degreeToRadian(double d){ | |
// 1 degree = 0.01745329252 radian ; | |
return d * 0.01745329252 ; | |
} | |
long moadele1(int x, int a, int b){ |
This file contains 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(){ | |
int a , n , j , tmay = 0 , tedad = 0 ; | |
cin >> a ; | |
for( n = 2 ; n <= a && a > 1; n++){ |
This file contains 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(){ | |
while(cin >> a >> b){ | |
cout << a + b << endl ; | |
} | |
} |