Write a programm such that
if user enter 11.25 it roundup to 11
but if user enter 11.51 upto 11.99 it will round up to 12
i.e.;convert the floting point value into integer format as
explain above..
Answers were Sorted based on User's Feedback
Answer / gsrinivas
#include<sdtio.h>
#include<math.h>
void main()
{
float x;
int y;
printf("\n entere the no");
scanf("%f",&x);
y=ceil(x);
y=floor(x);
printf("\n %d",y);
}
| Is This Answer Correct ? | 2 Yes | 1 No |
How we can insert comments in a c program?
Explain the concept and use of type void.
is it possible to change the default calling convention in c ?
Is c procedural or functional?
What is 'makefile' in C langauage? How it be useful? How to write a makefile to a particular program?
Explain threaded binary trees?
what is the use of #pragma pack, wer it is used?
Just came across this question, felt worth sharing, so here it is I want you to make a C/C++ program that for any positive integer n will print all the positive integers from 1 up to it and then back again! Let's say n=5 I want the program to print: 1 2 3 4 5 4 3 2 1. Too easy you say? Okay then... You can ONLY USE: 1 for loop 1 printf/cout statement 2 integers( i and n) and as many operations you want. NO if statements, NO ternary operators, NO tables, NO pointers, NO functions!
What are pointers in C?
The C language terminator is a.semicolon b.colon c.period d.exclamation mark
What is bss in c?
What are the 5 types of inheritance in c ++?