c programming



1.Program to print "Hello C" using if and else statement both

2. Program to print source code as program output

3. C program to design Login Screen by validation username and password

4. Program to print weekday of given date

 

  
Solution:
1. #include <stdio.h>

int main()
{

    if(!printf("Hello "))
        ;
    else
        printf("C\n");

    return 0;
}

2#include <stdio.h>

int main()
{
    FILE *fp;
    char c;

    fp = fopen(__FILE__, "r");

    do
    {
        c=fgetc(fp);
        putchar(c);
    }
    while(c!=EOF);

    fclose(fp);

    return 0;
}


Comments

Popular posts from this blog

C&C++ programming tricky questions

pointer in c