Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

string in c

#include<stdio.h>
void main(){
    int date;
    char fn[50], ln[50];
    printf("Enter your first name = ");
    scanf("%s",&fn);
    printf("Enter your last name = ");
    scanf("%s",&ln);
    printf("Enter your year of birth = ");
    scanf("%d",&date);
    printf("Your first name = %s
last name = %s
and year of birth = %d", fn, ln, date);
}
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #string
ADD COMMENT
Topic
Name
6+7 =