int i=2,j=3;
float a,b;
k=i/j*j;
l=j/i*i;
a=i/j*j;
b=j/i*i;
please sir can you provide me a answer for this question and explain me
1
Expert's answer
2015-07-17T02:38:19-0400
#include <stdio.h>
int main() { int k,l; // if k and l are integer values int i=2,j=3; float a,b;
// i/j*j is the same in C language as (i/j)*j // j/i*i is the same in C language as (j/i)*i k=i/j*j; // 2/3 = 0 (because of C language specification, int/int = int), 0*3 = 0 (it's clear) l=j/i*i; // 3/2 = 1 (because of C language specification, int/int = int), 1*2 = 2 (it's clear) a=i/j*j; // 2/3 = 0 (because of C language specification, int/int = int), 0*3 = 0 (it's clear), a-floating number => a=0.000000 b=j/i*i; // 3/2 = 1 (because of C language specification, int/int = int), 1*2 = 2 (it's clear), b-floating number => b=2.000000
printf("%d %d %f %f", k, l, a, b); // output is "0 2 0.000000 2.000000" return 0; }
Dear visitor, please use panel for submitting new questions.
rajashree g.s.
17.07.15, 18:54
#include int main() { int x=10,y=20; if(x==y); printf("\n %d %d",x,y);
return 0; } Actually there is no semicolon after the if statement know
sir. In this question there is semicolon after if statement. what will
be the output?.please explain the concept behind this sir.
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Dear visitor, please use panel for submitting new questions.
#include int main() { int x=10,y=20; if(x==y); printf("\n %d %d",x,y); return 0; } Actually there is no semicolon after the if statement know sir. In this question there is semicolon after if statement. what will be the output?.please explain the concept behind this sir.