Problem : https://www.hackerrank.com/challenges/c-tutorial-basic-data-types/problem
Solution :
#include <iostream>
Problem : https://www.hackerrank.com/challenges/c-tutorial-basic-data-types/problem
Solution :
#include <iostream>
Problem : https://www.hackerrank.com/challenges/cpp-input-and-output/problem
Solution : #include <cmath>
Problem : https://www.hackerrank.com/challenges/cpp-hello-world/problem
Solution :
1 - #include <iostream>
Problem : https://www.hackerrank.com/challenges/java-if-else/problem
Solution : import java.io.*;
Problem : https://www.hackerrank.com/challenges/java-stdin-and-stdout-1/problem
Solution : import java.util.*;
Problem : https://www.hackerrank.com/challenges/welcome-to-java/problem
Solution : public class Solution {Problem : https://www.hackerrank.com/challenges/c-tutorial-stringstream/problem
Solution :
#include <sstream>
Question : https://www.hackerrank.com/challenges/variable-sized-arrays/problem
Solution : #include <cmath>
/* Free your memory using this code
for(int i = 0; i < size; ++i)
{
delete[] A[i];
}
delete[] A;
*/
Problem : https://www.hackerrank.com/challenges/arrays-introduction/problem
Solution :
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
void reverse(int A[],int size){
for(int i = size -1 ;i>=0;i--){
cout<<A[i]<<" ";
}
}
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int size;
cin>>size;
int A[size];
for(int i =0;i<size;i++){
cin>>A[i];
}
reverse(A,size);
return 0;
}
Solution :
#include <stdio.h>
#include<math.h>
void update(int *pa,int *pb) {
// Complete this function
int temp = *pa;
*pa = *pa + *pb;
*pb = abs(temp - *pb);
}
int main() {
int a, b;
int *pa = &a, *pb = &b;
scanf("%d %d", &a, &b);
update(pa, pb);
printf("%d\n%d", a, b);
return 0;
}