Program to find the absolute value of given integer using
Conditional Operators
Answer Posted / apoorv gaurav
#include<stdio.h>
int main()
{
int a;
printf("Enter any number");
scanf("%d",&a);
if(a>=0)
printf("%d",a);
printf("%d",(-1*a));
return 0;
}
Is This Answer Correct ? | 7 Yes | 5 No |
Post New Answer View All Answers
What is the time and space complexities of merge sort and when is it preferred over quick sort?
What is dynamic variable in c?
Why flag is used in c?
What is difference between array and pointer in c?
What is the difference between call by value and call by reference in c?
What is the best way to store flag values in a program?
how to write a c program to print list of fruits in alpabetical order?
Stimulate calculator using Switch-case-default statement for two numbers
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
How are pointers declared in c?
Write a program to maintain student’s record. Record should
not be available to any unauthorized user. There are three
(3) categories of users. Each user has its own type. It
depends upon user’s type that which kind of operations user
can perform. Their types and options are mentioned below:
1. Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record)
2. Super Admin
(Search Record [by Reg. No or Name], View All Records,
Insert New Record, Modify Existing Record, Delete Single Record)
3. Guest
(Search Record [by Reg. No or Name], View All Records)
When first time program runs, it asks to create accounts.
Each user type has only 1 account (which means that there
can be maximum 3 accounts). In account creation, following
options are required:
Login Name: <6-10 alphabets long, should be unique>
Password: <6-10 alphabets long, should not display
characters when user type>
Confirm Password:
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.
What is d scanf?