C Program
#include <stdio.h>
int main(){
int n; scanf("%d",&n);
printf("%X",n);
return 0;
}C Output
Input: 255 Output: FF
C++ Program
#include <bits/stdc++.h>
using namespace std;
int main(){
int n; cin>>n;
cout<<uppercase<<hex<<n;
}C++ Output
Input: 4095 Output: FFF
JAVA Program
import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
System.out.println(Integer.toHexString(n).toUpperCase());
}
}JAVA Output
Input: 1234 Output: 4D2
Python Program
n=int(input()) print(hex(n)[2:].upper())
Python Output
Input: 1023 Output: 3FF
In-Depth Learning – Entire Concept in Paragraphs

Social Plugin