Pages

Friday, 21 December 2018

C PROGRAM TO ADD TWO NUMBERS WITHOUT USING ADDITION SYMBOL

#include<stdio.h>

void main()
{

int a=8,b=7,r;

r = a - ~b -1;

printf(" result is %d",r);

}

C Program used to scan a string with space and display by using scanf("%[^\n]s",name);

#include <stdio.h>

int main (int argc, char const *argv[])
{
    char name[20];
    scanf("%[^\n]s",name);
    printf("%s\n", name);
    return 0;
}

C Program used to scan a string without using %s format specifier in scanf statement

// program to scan a string without using %s format specifier in scanf statement
#include<stdio.h>
#define pf printf
#define sf scanf
void main()
 {
    char name[20];    
    pf("\nenter any string ");
    sf("%[^\n]s",name);
    pf("\nentered name is %s",name);
}






output:

Programs in turboc3 : Files

File Handling in C File Handling concept in C language is used for store a data permanently in computer. Using this concept we can store our...