answersLogoWhite

0


Best Answer

if your calculation involves a decimal point, u must use float, otherwise you can use integer for normal purpose.

for example,

if u want to divide some number, lets say 9/4 then u must use float to get the answer in accurate decimal point , otherwise if u use int there, the answer will be just 2 instead of 2.25

whenever we used an integer in the program we used int. if there is any decimal part in the number then we used float.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

It is one of the built-in data-types, it can hold a floating point value.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: When float used and when int used in C programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you convert integer to float?

Sure especially in programming. Generally an int can be passed directly into a float. Examples: 9 is an integer 9.00 is a float in programming int A = 9; Float B = A;


What is a long in c programming?

It is used with other data types such as long int or long float (=double). The capacity of the data types got increased with long keyword


What is a primitive type variable in c plus plus?

same the types used in C. that is int...char...float...


Weddle's rule in C programming language?

Code for TRAPEZOIDAL RULE in C Programming#include #include #include void main() { float x[10],y[10],sum=0,h,temp; int i,n,j,k=0; float fact(int); clrscr(); printf("\nhow many record you will be enter: "); scanf("%d",&n); for(i=0; i


C programming percentages?

float percent = ((float)CurrentItems / (float)MaxItems);


How do you declare a pointer variable in c?

int* pint; // instantiate a pointer to an int. float* pflt; // instantiate a pointer to a float.


Can a reserved word be used as an identifier name?

Identifiers are a bit more generic in the context of programming. If you mean, in terms of the C languages (C, C++, C#), the question is the reverse...keywords may NOT be used as identifiers. For example, you cannot use keywords such as "int", "float", "double", etc. as the names of variables or objects.


What are the data types privided in C?

int,float char,double ,long int,unsined int lots of others..


What is a constant as used in C programming?

A variable of which the value cannot change. Example of its usage: const int foo = 5;


What is protyping in c?

prototyping is declaring the function , its returntype, type of argument passed so that the compiler just know what the function if not defined yet will be doing. eg:- int xyz(int,float); //this is the prototype main() { int x; x=xyz(4,3.55); printf("%d",x); } int xyz(int a, float b) // actual definition of function { int c; c=a + b; return c; }


C plus plus programming for addition of two numbers?

int main() { int x = 40 + 2; }


Class data types in c?

The data types indicate the type of values that can be stored. The primary data types in c are:1. int, short, long, long long - used for integer values2. float, double - used for storing floating point numbers3. char - used for storing ASCII characters