Sunday, December 28, 2014

c programming(start-printf)

1:
#include<stdio.h>

int main( )
{
    printf("Hello world");
    return 0;
}

output: Hello world

2:(without using semicolon(;))
#include<stdio.h>

void main( )
{
while(!printf("Hello world") ){
}
}

3:
#include <stdio.h>

///***it will change your bg clor and font color:
int main()
{
    system("color 0C");
    printf("Hello world");
    return 0;
}

output: Hello world

4:
#include <stdio.h>
///***without using semicolon

void main()
{
    system("color 0C");
    if(printf("Hello world")){
    }
}



output: Hello world

5:
#include <stdio.h>
///***without using semicolon

void main()
{
    system("color 0C");
    switch(printf("Hello world)){
    }
}

output: Hello world
///***here 0 use for background color and C is use for font color:follow this pattern
///***0=Black        A=Light green
         1= Blue         B=Light Aqua
         2=Green        C=Light Red
         3=Aqua         D=Light Purple
         4=Red           E=Light Yellow
         5=Purple       F=Bright White
         6=Yellow
         7=White
         8=Gray
         9=Light Blue

No comments:

Post a Comment