Example of C Source Code to read and display int value - C Language Basics

C examples for Language Basics:Hello World

Description

Example of C Source Code to read and display int value

Demo Code

#include <stdio.h> 
int main(void) 
{ 
    int dogs; //  w w w  . java 2  s . co m
 
    printf("How many dogs do you have?\n"); 
    scanf("%d", &dogs); 
    printf("So you have %d dog(s)!\n", dogs); 
 
    return 0; 
}

Related Tutorials