C Bit Manipulation Program Attached are the instructions as
C++ Bit Manipulation Program. Attached are the instructions as well as some notes I took for guidance on how to program it. You must use uint and scoped enum. Thank you!
Solution
#include<iostream>
#include<string.h>
Using namespace STD;
String rgbtohex(INT r, INT g, INT b,INT a)
{
Cout<<rgbtohex (255,255,255).c_str;
Return 0;
}
String rgbtohex (INT rno,INT gno,INT bno,INT a)
{
String result;
Char r[255];
sprintf_s(r,\"%2X\",rno);
result.append(r);
Char g[255];
Sprintf_s(g,\"%2X\",gno);
Result.append(g);
Char b[255];
stringf_s(b,\"%2X\",bno);
Result.append(b);
Char a[255];
stringf_s(a,\"%2X\",ano);
Return result;
}
Ex::
Unsigned long rgb=creatergb(oxFA,0x09,oxCA)
Unsigned long creatergb(int r,int g,int b)
{
Return((r&oxff)<<24)+((g&oxff)<<16)+((b&oxff)<<8)+(a&oxff);
}

