What if printf() is missing a parameter? - C Language Basics

C examples for Language Basics:printf

Description

What if printf() is missing a parameter?

Demo Code

#include <stdio.h>
int main(void)
{
    int ten = 10;
    int two = 2;/*ww w.j a v a2 s  .  c om*/
    
    printf("Doing it right: ");
    printf("%d minus %d is %d\n", ten, 2, ten - two );
    printf("Doing it wrong: ");
    printf("%d minus %d is %d\n", ten );  // forgot 2 arguments
    
    return 0;
}

Related Tutorials