A friend showed me this c-language code, and I'm very confused with its output. Can any one please explain why is it giving output "It was a piece of black forest cakeThis is weird", instead of "It was a piece of black forest cakeIt was a piece of black forest cake"?
# include <cstdio>
using namespace std;
int main()
{
    float a = 0.5;
    if(a < 0.5) 
        printf("This is Weird");
    else 
        printf("It was a piece of black forest cake");
    float b = 0.7;
    if(b < 0.7)
        printf("This is Weird");
    else 
        printf("It was a piece of black forest cake");
    return 0;
}
 
     
    