Question:

What is an "integer" in C Progamming?

by  |  earlier

0 LIKES UnLike

Hi Friends,

i m doing M.Sc. IT. i have problems with C Language. i dont no ABC... of C Programming. i want to know how to make one program? what is 'integer'? my friends told me that first i should make simple program e.g. program for addition or program for substraction. but i dont know how to make these program.

i need help. Pleeeeeeeeeeeeeeeeeeeeeeeeeeeeeese help me.

Thanks

 Tags:

   Report

7 ANSWERS


  1. hello friend don't be afraid.The c language is very simple and if you understand it you can do a program very easily.

    http://en.wikipedia.org/wiki/C_(programm... gives you a overview about c language

    now i come to a simple addition program in c

    for addition we need atleast two numbers let a,b

    we can add numbers of any type like whole numbers(...-3,-1,0,1,2,3...),decimal numbers etc.if we want to add whole numbers then we can declare the a,b as integer (to know more about integer and its type go to http://home.att.net/~jackklein/c/inttype... page )

    now you clear about integer i think.

    integer is a data type that has a range between -32768to 32767.

    now come to the program

    for a c program the following steps to be followed

    * header files

    * main function (void main)

    * declaration

    * operations

    * result

    * header file

    for a c program the main header file is stdio.h

    #include<stdio.h>

    this file include the standard input output which is used in c.to know more about header file http://en.wikipedia.org/wiki/Header_file

    * main function (void main)

    main function is the main part of the program which is used to do operations,calling functions which are present outside the main etc

    most probably we use void main() which refers that the function does not return a value

    * declaration

    we are going to add two numbers let a,b and store the result in x (a,b,xvariables) so we have to declare them as integer as

    int a,b,x;

    * operations

    now we have to assign the value for a,b directly or we can get it as input while running

    that is

    directly as

    a=20;

    b=30;

    or

    printf("enter the values a and b:");

    scanf("%d %d",&a,&b);

    now perform addition and store the result in x

    that is x=a+b

    * result

    now print the result as

    printf("the result is:%d",c);

    now are you clear now try the program

    i had provide the program below but try it first by your own

    you can copy the below mentioned program and 1.save it in a text document 2. open tc and open this text document 3.save as(from file save as) .c file i.e name.c then compile and run the program

    give the input 30

    20

    output will be

    the result is :50

    program

    #include<stdio.h>

    #include<conio.h>

    void main()

    {

    int a,b,x; //declaration of a,b,x as integer

    clrscr(); //for clearing the screen

    printf("enter the value for a and b");

    scanf("%d%d",&a,&b); //getting the input for a,b

    x=a+b; //performing addition and storing the value in x

    printf("the result is :%d",x); //displaying the result

    getch();

    }

    if any dought mail to me (iam also an IT student) i will answer u if i can with pleasure

    all the best


  2.    in c language integer is a kind of datatype which tells u wat kind of value u can store in a variable it allows u to take whole numbr values like 1,2,3....it have a range from  -32467 to +32467 till these values u can give any value it dosent xcept fractional part

  3. An integer is a number, it's as simple as that.

    5 is an integer.

    46516 is an integer.

    -984 is an integer.

  4. More precisely, an integer is a WHOLE number. Any number that is not fractional (e.g  2.5, 3.1415, -0.25) is an integer.

  5. an integer is a whole number however its value in c is limited if u r using a 16 bit compiler(turbo c) it can take values             b/w   -32768 to 32767

  6. There are several different integer types, the "int" type is the most common. This video can explain them to you:

    http://xoax.net/comp/cpp/console/Lesson2...

    Also, if you like you can start learning C++ with these video tutorials:

    http://xoax.net/comp/cpp/console/index.p...

    They are perfect for beginners. This one can get you started by showing you how to install a free compiler:

    http://xoax.net/comp/cpp/console/Lesson0...

    You can go through the tutorials and if you have questions on them or anything else in C++, please post to me here:

    http://xoax.net/forum/

  7. what is an "integer" in C Programming?

    int i; //i has type integer

    Take my advice and download Microsoft's free Visual Studio Express with C#. The C# language is much easier to use.

Question Stats

Latest activity: earlier.
This question has 7 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions