Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

My Compiler For your projects

c

#include <stdio.h>

int main()
{
    printf("Hello, World!\n");

    return 0;
}

Sumof digits bakoabbmqkhvvjk

c

#include <stdio.h>
void main()
{
    int n, m, digit, sum;
    sum=0;
    printf("\n enter a positive integer");
    scanf("%d", &n);
    m=n;
    while (n>0)
    {
        digit = n%10;
        sum= sum+digit;
        n=n /10;
    }
    n=m;
    printf("\n sum of digits of given number %d = %d", n, sum);
}

hkdsyjfujkyjhfxcghdrgytgtfhyrtyhthtrdhytjh

c

#include <stdio.h>

int main()
{
    printf("Hello, World!\n");

    return 0;
}

ok ok ok ok ok ok ok ok ok o ko k ok o k ok

c

#include <stdio.h>
 
int main(){
    short image[60][40]; // the array to store the text image
    FILE * infile = fopen("inimage.txt", "r"); // text image input file
 
    for(int i = 0; i < 60; i++){
        for(int j = 0; j < 40; j++){
            fscanf(infile, "%d\t", &image[i][j]); // this will read an integer and store it in the array, then read a tab
        }
    }
 
    short quick_mask[3][3] = { {-1, 0, -1}, {0, 4, 0},{-1, 0, -1} }; // this is the mask which will be convoluted with the image array
 
    short store = 0; // integer to store each output element
    FILE * outfile = fopen("outimage.txt", "w"); // text image output folder
 
    // nested for loop to perform the convolution
    for(int i = 0; i < 60; i++){
        for(int j = 0; j < 40; j++){
            if(i < 58 && j < 38) // to skip the edge of the text image
                {
                    // convolution calculation ( mask * image)
                    store = (image[i-1+1][j-1+1]    * quick_mask[0][0])     +
                    (image[i-1+1][j+1]  * quick_mask[0][1])     +
                    (image[i-1+1][j+1+1]    * quick_mask[0][2])     +
                    (image[i+1][j-1+1]  * (quick_mask[1][0])    +
                    (image[i+1][j+1])   * quick_mask[1][1])     + 
                    (image[i+1][j+1+1]  * quick_mask[1][2])     +
                    (image[i+1+1][j-1+1]    * quick_mask[2][0])     + 
                    (image[i+1+1][j+1]  * quick_mask[2][1])     + 
                    (image[i+1+1][j+1+1]    * quick_mask[2][2])     ;
                }
            else{
                // edges will be always 0
                store = 0;
            }
 
            if(store < 0) store = 0; // min color is black (0)
            else if(store > 255) store = 255; // max color is white ( 255)
            fprintf(outfile, "%d\t", store); // write the output into a file
        }
        fprintf(outfile, "\n"); // add a new line each row
    }
 
    return 0; // end of the program
}

MyAttemptAtTaskOneSummerWork

c

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


int main()
{
        int val1=0;
        int val2=0;
        printf("Enter two numbers to be multiplied:");
        fflush(stdin);
        scanf("%f,%f",&val1, &val2);
        printf("\nThe product of these two numbers is: ""%f", val1*val2 );
        system("pause");
        return 0;
}

Compile and Execute C Online

c

#include <stdio.h>

int main()
{
    printf("Hello, Tom and we!\n");

    return 0;
}

Compile and Execute C Online

c

#include <stdio.h>

void fun(int arr[])
{
int i;
int arr_size = sizeof(arr)/sizeof(arr[0]);
printf("sizeof arr %d",sizeof(arr));
printf("\n size of first element %d",sizeof(arr[0]));
for (i = 0; i < arr_size; i++)
{
printf("%d ", arr[i]);
}
}

int main()
{
int i;
int arr[4] = {10, 20 ,30, 40};
fun(arr);
}

C program to print size of an empty structure

c

#include <stdio.h>

//structure with no members
struct temp
{
    
};


int main()
{
    //declaring stcurure variable
    struct temp T;
    
    printf("Size of T: %d\n",sizeof(T));

    return 0;
}

WTF: compare integer and boolean

c

#include <stdio.h>
#include <stdbool.h>


bool test1()
{
    int a = 5;
    
    if ( a == true ){
        return true;
    }else{
        return false;
    }
}


int main()
{
    
    if(test1()){
        printf("true\n");
    }else{
        printf("false\n");
    }

    return 0;
}

Compile and Execute C Online

c

%{
#include<stdio.h>
int vowels=0;
int cons=0;
%}
%%
[aeiouAEIOU] {vowels++;}
[a-zA-Z] {cons++;}
%%
int yywrap()
{
return 1;
}
main()
{
printf("Enter the string.. at end press ^d\n");
yylex();
printf("No of vowels=%d\nNo of consonants=%d\n", vowels,cons);
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.