answersLogoWhite

0

Add your answer:

Earn +20 pts
Q: Difference between signed and unsigned int?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Basic Math

What is the difference between function and recursive function?

I will explain in the easiest way the difference between the function and recursive function in C language. Simple Answer is argument of the function is differ but in the recursive function it is same:) Explanation: Function int function(int,int)// function declaration main() { int n; ...... ...... n=function(a,b); } int function(int c,int d) { ...... ...... ...... } recursive Function: int recursive(int,int)// recursive Function declaration main() { int n; ..... ..... ..... ..... n=recursive(a,b); } int recursive(int a,int b) { ..... .... .... .... } Carefully see, In the recursive Function the function arguments are same.


What is the algorithm for finding the prime numbers between 1 and 100?

Code example:/* ******************************************************************************** * FUNCTION: bIsAPrime ******************************************************************************** * AUTHORS: * Flaun * * DESCRIPTION: * Finds if a given number is a prime number. * * PARAMETERS: * uiTestNumber: An unsigned integer to test. * * RETURNS: * bTRUE or bFALSE ******************************************************************************** */ #define bTRUE 1 #define bFALSE 0 #define iNO_REMAINDER 0 #define bIS_ODD(uiNumber) ((uiNumber) & 1) typedef int BOOL BOOL bIsAPrime( unsigned int uiTestNumber) { /* 4 is the first non prime number. */ if(uiTestNumber > 3) { /* The only even prime number is 2. */ if(!bIS_ODD(uiTestNumber)) { return bFALSE; } else { /* The only numbers left to divide against are 3, 5 and 7. */ /* All numbers that are divisible by a number > 7 are divisible */ /* by a number < 8. */ unsigned int uiDivisor = 0; for(uiDivisor = 3; uiDivisor


What is largest number in 11 bits?

Assuming it is an unsigned int (i.e. no negatives) it would be 11111111111 which is 2047. Another way to think about it is 11bits can represent 2048 different values, and since it starts at 0 that would be 2048 - 1 which is 2047.


Do while loop examples?

i=0; do{ i++; }while(i&lt;10);


What is function parameters?

whatever the variables we declare in function signature to receive the arguments at the calling that are known as parameters.. e.g. int sum(int a,int b); here a &amp; b are known as parameters.....

Related questions

What is the difference between unsigned and int?

The value range. Example for 16-bit integers: signed: -32768..32767 unsigned: 0..65535


What are the four integral types in C plus plus?

There are far more than 4 integral types in C++. As of C++11, there were 27 integral types: bool char signed char unsigned char wchar_t char16_t char32_t short signed short unsigned short short int signed short int unsigned short int int signed int unsigned int long signed long unsigned long long int signed long int unsigned long int long long signed long long unsigned long long long long int signed long long int unsigned long long int


What are the qualifiers that an int can have at a time?

A signed int can take a value between -32768 to 32767 and an unsigned int can take a value 0 to 65535.


What is difference between unsignedint and signedint in c language?

Unsigned int does not have a sign, meaning that it can be zero or a positive number in the range of data type (int). Signed data has a sign and can be positive, zero or negative.


What is the type modifier?

A type modifier changes the default variable type to the other possible type. An int is signed by default and may be made unsigned int a; unsigned int b;


What is the difference between datatypes and modifiers in c language?

For example 'int' is a data-type, 'short', 'long', 'signed' and 'unsigned' are modifiers, 'extern', 'auto', 'static', 'register' are storage-classes. The declarations go like this: storage-class modifiers data-type identifier example: static unsigned short int x;


Examples on types of in c?

signed char unsigned long int void *


Why does c plus plus have type modifiers?

There are four modifiers in C++: long, short, signed and unsigned. They are used to modify primitive types (int, char, float and double) to change their behaviour. If no type is specified, int is assumed. Thus a long long turns a 32-bit integer into a 64-bit integer while unsigned ensures an integer is always in the positive range.


What are the different types of integer constants in c language?

Well, uh, const unsigned int and const signed int..


What are 5 different types of modifiers in c plus plus?

There are five type modifiers in C++: long short signed unsigned [] - the array subscript The first four are used solely to modify the characteristics of the int type. Signed and unsigned can also be applied to the char and wchar_t types while long can also be applied to a double. If no type is specified, int is assumed. The array subscript modifier can be applied to any type including modified types and pointers to a type. Excluding arrays, pointers and the built-in bool type, C++ has the following fundamental (built-in) types: char signed char unsigned char wchar_t signed wchar_t unsigned wchar_t int signed int unsigned int short int signed short int unsigned short int long int signed long int unsigned long int long long int signed long long int unsigned long long int float double long double A plain (unmodified) char may be signed or unsigned (implementation defined) but must behave exactly as an explicitly signed or unsigned char would. However, all three are deemed separate types in C++. Similarly with wchart_t. However, an int is implicitly signed. The length of each fundamental type is implementation defined, but can be found by using the sizeof operator either upon the type itself or upon an instance of the type. The standard library &lt;type_traits&gt; header can be used to determine other information, particularly useful in static (compile-time) assertions. The C++ standard library also provides additional types of specific size, including int8_t, int16_t, int_32_t, int64_t, uint_8_t, uint_16_t, uint32_t and uint64_t. Note that the _t suffix is often used to denote that a type is really a typedef (an alias) for a modified type, such as size_t (an unsigned int). However wchar_t is typically implemented as a built-in type. All fundamental types can be found in &lt;cstddef&gt; (which is usually included when you include any standard library header such as &lt;iostream&gt;) while the fixed-length integers can all be found in &lt;cstdint&gt;.


Types of data in turbo C programming?

The primitive data types in C include:[signed|unsigned] char[signed|unsigned] short[signed|unsigned] int[signed|unsigned] long[signed|unsigned] long longfloatdoublelong doubleEnumerations (enum) and arrays may also be considered to be primitive types.


Give the program to find Armstrong numbers between n and m in turbo c plus plus?

#include &lt;iostream&gt; #include &lt;math.h&gt; // for std::pow() unsigned int get_length(unsigned int num,const unsigned int base=10) { unsigned int len=1; while(num &amp;&amp; (num/=base)) ++len; return( len ); } bool is_armstrong(const unsigned int num,const unsigned int base=10) { unsigned int len=get_length(num,base); unsigned int sum=0; unsigned int tmp=num; while(tmp) { sum+=(unsigned int)std::pow((double)(tmp%base),(double)len); tmp/=base; } return(num==sum); } int main() { std::cout &lt;&lt; "Armstrong series (base 10):"; for(unsigned int num=0; num&lt;=0xffffffff; ++num) if(is_armstrong(num)) std::cout &lt;&lt; " " &lt;&lt; num; std::cout &lt;&lt; std::endl; return(0); }