Tuesday, 27 August 2013

c program to demonstrate "sscanf"

/*
    Date: 21/08/13 17:39
    Description: demonstrates the conversion functions
*/

#include<stdio.h>
#include<stdlib.h>

int main()
{
  
    int i=12;
    char str[20];
    int day=0,year=0;
    char month[20];
  
    //itoa(i,str,8); //10 radix value
    //sprintf(str,"%d" "%s",i,"rajashekar");
  
    printf("please enter the date(dd/mm/yyyy):");
    sscanf(str,"%d" "%s" "d" );
  
  
    printf(month);
    getch();
    return 0;
}

No comments:

Post a Comment