If Else

Basics

1. int main()
    {
        char c='A';
        printf("%c %d",c,c);
    }
Answer: A 65

2. int main()
    {
        int a=4,b,c;
        c=a+b;
        printf("%d",c);
    }
Answer: 765437(Garbage Value)

3. int main()
    {
        int x=4,y=7,z,s;
        z=x=y;
        s=x+y+z;
        printf("%d",s);
    }
Answer: 21

4. int main()
    {
        int a=5,b=6,c,d;
        c=a+b;
        d=a+d;
        printf("%d %d",c,d);
    }
Answer: 11 420661(Garbage Value)

5. int main()
    {
        int z;
        z=(5+7/2*3)/7*2;
        printf("%d",z);
    }
Answer: 4

6. int main()
    {
        int a=7,b;
        float c;
        b=2.0;
        c=a/b;
        printf("%f",c);
    }
Answer: 3.000000

7. int main()
    {
        float z;
        z=5/2+(float)7/2;
        printf("%f",z);
    }
Answer: 5.500000

8. int main()
    {
        int r;
        r=20 % 3 * 10 + 8 / 2;
        printf("%d",r);
    }
Answer: 24

9. int main()
    {
        char v1='a',v2='b';
        int v3=v1+v2;
        printf("%d",v3);
    }
Answer: 195

10. int main()
    {
        int km, m=150.0;
        km=m/1000;
        printf("%d",km);
    }
Answer: 0

11. int main()
    {
        int x=printf("JAVA");
        printf("%d",x);
    }
Answer: 4
Confirm Your Answer