0% found this document useful (0 votes)
6 views4 pages

C Programming Code Snippets and Examples

Uploaded by

Mai Gado
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

C Programming Code Snippets and Examples

Uploaded by

Mai Gado
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

#include<stdio.

h>

int main()
{
void fun();
fun();
printf("\n");
return 0;
}
void fun()
{
char ;
if(( = getchar())!= '\n')
fun();
printf("%c", );
}

void fun();

fun(); fun()

fun()

#include<stdio.h>

int main()
{
printf("India", "BIX\n");
return 0;
}
printf("India", "BIX\n"); ,

#include<stdio.h>

int main()
{
char [7] = "IndiaBIX";
printf("%s\n", );
return 0;
}

str[]
'\0'
#include<stdio.h>

int main()
{
char * [] = { "Suresh", "Siva", "Sona", "Baiju", "Ritu"};
int ;
char * ;
= [3];
[3] = [4];
[4] = ;
for( =0; <=4; ++)
printf("%s,", [ ]);
return 0;
}

char *names[] = { "Suresh", "Siva", "Sona", "Baiju", "Ritu"}; names

int i; i

char *t; t

t = names[3]; names[3] = names[4]; names[4] = t;


names

for(i=0; i<=4; i++) printf("%s,", names[i]);


names

#include<stdio.h>
#include<string.h>

int main()
{
char [] = "India\0\BIX\0";
printf("%d\n", strlen( ));
return 0;
}
strlen

strlen(str) strlen("India")

You might also like