Skip to main content

Absolute value and Floating-point absolute value function in C Programming Language



Absolute value function in C Programming Language is abs(i), Its return the absolute valu of i. where  i  is any positive or negative  number. It is integer type function. The include file of abs(i) is stslib.h
Observe under program:

#include<stdio.h>

#include<stdlib.h>
int main(void)
{
int a;
scanf("%d",&a);
printf("%d",abs(a));
}
Here I use a integer number. Input it by scanf and print the Absolute value by abs() function.



Floating-point Absolute value function in C Programming Language is fabs(i), Its return the absolute valu of i. where  i  is any positive or negative  Floating-point number. It is double integer type function. The include file of fabs(i) is math.h
Observe under program:


#include<stdio.h>

#include<stdlib.h>
 int main(void)
{
float a;
scanf("%f",&a);
printf("%.2f",fabs(a));
}

Here I use a integer number. Input it by scanf and print the Floating-point Absolute value by abs() function.
If you have any problems tell me by comment. Thanks all.

Comments

  1. I actually enjoyed reading through this posting.Many thanks.
















    Function Point Estimation Training

    ReplyDelete
  2. best and useful sites and I like the sites.
    oracle training in chennai

    ReplyDelete
  3. • Looking for real-time training institute.
    ios training in chennai

    ReplyDelete
  4. I love to read your sections because your signature technique is too good, it is very very effective for all of us and I never get bored while learning your article because they become a more and more interesting from the starting lines until the end.Java Training in Chennai
    Java Training

    ReplyDelete
  5. I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.digital marketing training in chennai

    ReplyDelete
  6. Very useful site and good explanation about C Program
    Oracle DBA training in pune

    ReplyDelete
  7. Thanks for sharing the c programming language.
    Oracle Online Training

    ReplyDelete
  8. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Devops Training in Chennai

    Devops Training in Bangalore

    Devops Training in pune

    ReplyDelete
  9. Have you been thinking about the power sources and the tiles whom use blocks I wanted to thank you for this great read!! I definitely enjoyed every little bit of it and I have you bookmarked to check out the new stuff you post
    Data Science with Python training in chenni
    Data Science training in chennai
    Data science training in velachery
    Data science training in tambaram
    Data Science training in OMR
    Data Science training in anna nagar
    Data Science training in chennai
    Data science training in Bangalore

    ReplyDelete
  10. I am definitely enjoying your website. You definitely have some great insight and great stories. 
    python training institute in chennai
    python training in Bangalore
    python training in pune
    python online training

    ReplyDelete
  11. Read all the information that i've given in above article. It'll give u the whole idea about it.

    Blueprism training in tambaram

    Blueprism training in annanagar

    Blueprism training in velachery

    ReplyDelete
  12. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
    fire and safety course in chennai

    ReplyDelete
  13. Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.

    Selenium Interview Questions and Answers

    Best Selenium Training in Chennai | Selenium Training Institute in Chennai | Besant Technologies

    Selenium Training in Bangalore | Best Selenium Training in Bangalore

    Free Selenium Tutorial |Selenium Webdriver Tutorial |For Beginners




    ReplyDelete
  14. Anyhow I am here now and would just like to say thanks a lot for a tremendous post and an all-round exciting blog
    iosh course in chennai

    ReplyDelete
  15. Nice blog!! I really got to know many new tips by reading your blog. Thank you so much for a detailed information! It is very helpful to me. Kindly continue the work.

    French Class in Mulund
    French Coaching in Mulund
    French Classes in Mulund East
    German Classes in Mulund
    German Language Classes in Mulund
    German Classes in Mulund West
    German Coaching Center near me

    ReplyDelete
  16. Thanks for sharing this informative blog. I have read your blog and I gathered some valuable information from this
    blog. Keep posting.

    Education
    Technology

    ReplyDelete

Post a Comment

Give your valuable Comment...

Popular posts from this blog

Object-Oriented Programming and JAVA Programming Language

  Object-Oriented Programming and:   Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, messaging, modularity, olymorphism, and inheritance. Many modern programming languages now support OOP, at least as an option. JAVA Programming Language: Object-oriented programming is at the core of Java. In fact, all Java programs are object-oriented, this isn’t an option the way that it is in C++, for example. OOP is so integral to Java that you must understand its basic principles before you can write even simple Java programs. Therefore, this chapter begins with a discussion of the theoretical aspects of OOP.

Read or input form user in Java using BufferedReader

 BufferedReader use to read text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.The buffer size may be specified, or the default size may be used. The default is large enough for most purposes. In Java  BufferedReader is a efficient method to read an input. Here given a short example to read a string from user and print it: package palindrome; import java.io.BufferedReader; import java.io.InputStreamReader; public class  inputExample   {     public static void main(String[] args) throws Exception {    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));     String s = new String();       s =br.readLine();     System.out.println(s);     } }