Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How to use the"int" command

+4 votes
asked Feb 2, 2023 by Silv5r D4gger (180 points)
i dont know how to use it, can someone explain with an example please? thks

3 Answers

0 votes
answered Feb 2, 2023 by Peter Minarik (86,040 points)

int means integral data type, that is a number that does not have any fractional part. If it helps, in Math it would be Z. Such numbers are ..., -2, -1, 0, 1, 2, ...

In C, you could write the following code:

#include <stdio.h>

int main()
{
    int age;
    printf("Enter your age: ");
    scanf("%d", &age);
    printf("You are %d years old.\n", age);
    return 0;
}
0 votes
answered Feb 5, 2023 by SACHIN YADAV (260 points)
edited Feb 5, 2023 by SACHIN YADAV

Int function define the integer value which entered from keyboard.int function denotes that it has occurred only integer value not have fractional value.for example in C we write a program like:

#include<stdio.h>
int main ()
{
int num;
printf("enter the value of num: ");
scanf("%d",&num);
num=num+1;
printf("the next integer of your integer value =%d",num);
return 0;
}
 

0 votes
answered Feb 15, 2023 by NEKKALAPU SHANMUKHA SURYATEJA (180 points)

let's go into python 
number = int(input("enter number"))

print(type(number))

print(number)

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...