Example program which uses sscanf and sprintf functions in C

#include <stdio.h>
 
 int main()
 {
    char s2[130];
 
    int i, j;
    printf("Enter two numbers : n");
    gets(s2);
    sscanf(s2,"%d%d",&i,&j);
    printf("nThe values are : %d and %d.n",i,j);
    return 0;
 }

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.