99. Program to count frequency of characters in a string.
#include<stdio.h>
#include<string.h>
#include<conio.h>
void main()
{
char str[1500];
int c = 0, count[26] = {0};
clrscr();
printf("Enter a string : ");
gets(str);
while (str[c] != '\0')
{
if (str[c] >= 'a' && str[c] <= 'z')
count[str[c] - 'a']++;
c++;
}
for (c = 0; c < 26; c++)
{
if (count[c] != 0)
printf("%c occurs %d times in the string.\n", c + 'a', count[c]);
}
getch();
}
@programming_and_coding
#include<stdio.h>
#include<string.h>
#include<conio.h>
void main()
{
char str[1500];
int c = 0, count[26] = {0};
clrscr();
printf("Enter a string : ");
gets(str);
while (str[c] != '\0')
{
if (str[c] >= 'a' && str[c] <= 'z')
count[str[c] - 'a']++;
c++;
}
for (c = 0; c < 26; c++)
{
if (count[c] != 0)
printf("%c occurs %d times in the string.\n", c + 'a', count[c]);
}
getch();
}
@programming_and_coding
100. Program to count total number of uppercase and lowercase in a string.
#include<stdio.h>
#include<string.h>
#include<conio.h>
void main()
{
int upper = 0, lower = 0;
char ch[80];
int i;
clrscr();
printf("Enter string : ");
gets(ch);
i = 0;
while (ch[i] != '\0')
{
//uppercase counter
if (ch[i] >= 'A' && ch[i] <= 'Z')
{
upper++;
}
//lowercase counter
if (ch[i] >= 'a' && ch[i] <= 'z')
{
lower++;
}
i++;
}
printf("\nUppercase Letters : %d", upper);
printf("\nLowercase Letters : %d", lower);
getch();
}
@programming_and_coding
#include<stdio.h>
#include<string.h>
#include<conio.h>
void main()
{
int upper = 0, lower = 0;
char ch[80];
int i;
clrscr();
printf("Enter string : ");
gets(ch);
i = 0;
while (ch[i] != '\0')
{
//uppercase counter
if (ch[i] >= 'A' && ch[i] <= 'Z')
{
upper++;
}
//lowercase counter
if (ch[i] >= 'a' && ch[i] <= 'z')
{
lower++;
}
i++;
}
printf("\nUppercase Letters : %d", upper);
printf("\nLowercase Letters : %d", lower);
getch();
}
@programming_and_coding
101. Program to calculate the length of string.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[100];
int length;
clrscr();
printf("\nEnter a string to calculate it's length : ");
gets(a);
length = strlen(a);
printf("\nLength of entered string is : %d", length);
getch();
}
@programming_and_coding
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char a[100];
int length;
clrscr();
printf("\nEnter a string to calculate it's length : ");
gets(a);
length = strlen(a);
printf("\nLength of entered string is : %d", length);
getch();
}
@programming_and_coding
Data_Structures_Using_C.pdf
18.3 MB
Oxford book
#Data_Structure
Join us on telegram:-
@programming_and_coding
Data_structure using c language #Data_Structure
Join us on telegram:-
@programming_and_coding
Amazon Hiring Programmer Analyst - Intern
https://www.amazon.jobs/en/jobs/1375720/programmer-analyst-intern
Telegram:@programming_and_coding
Update 5
https://www.amazon.jobs/en/jobs/1375720/programmer-analyst-intern
Telegram:@programming_and_coding
Update 5
102. Program to calculate the length of string without using strlen() function.
#include<stdio.h>
#include<conio.h>
void main()
{
char s[1000], i;
clrscr();
printf("Enter a string : ");
scanf("%s", s);
for (i = 0; s[i] != '\0'; ++i);
printf("Length of string : %d", i);
getch();
}
//for more update join us on telegram
@programming_and_coding
#include<stdio.h>
#include<conio.h>
void main()
{
char s[1000], i;
clrscr();
printf("Enter a string : ");
scanf("%s", s);
for (i = 0; s[i] != '\0'; ++i);
printf("Length of string : %d", i);
getch();
}
//for more update join us on telegram
@programming_and_coding
Accenture Off Campus Drive For 2021 Batch PAN India
Apply Link:-π
https://indiacampus.accenture.com/register/accenture/vspn1/apply/?event=2695&job=1122
Join us :-@programming_and_coding
#Update_6
Apply Link:-π
https://indiacampus.accenture.com/register/accenture/vspn1/apply/?event=2695&job=1122
Join us :-@programming_and_coding
#Update_6
103. Program to check the palindrome of string.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char text[100];
int begin, middle, end, length = 0;
clrscr();
printf("Enter the string to check if it is a palindrome : \n");
gets(text);
while (text[length] != '\0')
{
length++;
}
end = length - 1;
middle = length / 2;
for (begin = 0; begin < middle; begin++)
{
if (text[begin] != text[end])
{
printf("\nString is not a palindrome.");
break;
}
end--;
}
if (begin == middle)
printf("\nString is Palindrome.");
getch();
}
@programming_and_coding
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char text[100];
int begin, middle, end, length = 0;
clrscr();
printf("Enter the string to check if it is a palindrome : \n");
gets(text);
while (text[length] != '\0')
{
length++;
}
end = length - 1;
middle = length / 2;
for (begin = 0; begin < middle; begin++)
{
if (text[begin] != text[end])
{
printf("\nString is not a palindrome.");
break;
}
end--;
}
if (begin == middle)
printf("\nString is Palindrome.");
getch();
}
@programming_and_coding
Discovery is Hiring for SDE - I roles
Apply At: https://jobs.discovery.com/job/Mumbai-Software-Development-Engineer-I-MH-400051/680764400/
Join @programming_and_coding
Apply At: https://jobs.discovery.com/job/Mumbai-Software-Development-Engineer-I-MH-400051/680764400/
Join @programming_and_coding
104. Program to check the palindrome of word using array.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char word[100];
int length, counter;
clrscr();
printf("Enter a word : ");
scanf("%s", word);
length = strlen(word);
int flag = 1;
for (counter = 0; counter < length / 2 && flag; counter++)
{
if (word[counter] != word[length - counter - 1])
{
flag = 0;
break;
}
}
if (flag)
{
printf("\n%s is a palindrome.", word);
}
else
{
printf("\n%s is NOT a palindrome.", word);
}
getch();
}
@programming_and_coding
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char word[100];
int length, counter;
clrscr();
printf("Enter a word : ");
scanf("%s", word);
length = strlen(word);
int flag = 1;
for (counter = 0; counter < length / 2 && flag; counter++)
{
if (word[counter] != word[length - counter - 1])
{
flag = 0;
break;
}
}
if (flag)
{
printf("\n%s is a palindrome.", word);
}
else
{
printf("\n%s is NOT a palindrome.", word);
}
getch();
}
@programming_and_coding
Internship Alert β‘
1.) Amazon is Hiring Software Development Engineer Intern
Apply: https://lnkd.in/e33CbbG
2.) Dassult Systems is Hiring Software Development Intern
Apply: https://lnkd.in/g-Z-6Rz
New Grad 2021*
Join:- @programming_and_coding
For more update instantly
1.) Amazon is Hiring Software Development Engineer Intern
Apply: https://lnkd.in/e33CbbG
2.) Dassult Systems is Hiring Software Development Intern
Apply: https://lnkd.in/g-Z-6Rz
New Grad 2021*
Join:- @programming_and_coding
For more update instantly
lnkd.in
LinkedIn
This link will take you to a page thatβs not on LinkedIn
105. Program to remove white space in string.
#include<string.h>
#include<stdio.h>
#include<conio.h>
void main()
{
int i = 0, j = 0, len;
char buff[50];
clrscr();
printf("Enter String with white space : ");
gets(buff);
len = (int) strlen(buff);
while (i != len)
{
if (buff[i] != ' ')
buff[j++] = buff[i];
i++;
}
buff[j] = 0;
printf("\nYour String is : %s.", buff);
getch();
}
@programming_and_coding
#include<string.h>
#include<stdio.h>
#include<conio.h>
void main()
{
int i = 0, j = 0, len;
char buff[50];
clrscr();
printf("Enter String with white space : ");
gets(buff);
len = (int) strlen(buff);
while (i != len)
{
if (buff[i] != ' ')
buff[j++] = buff[i];
i++;
}
buff[j] = 0;
printf("\nYour String is : %s.", buff);
getch();
}
@programming_and_coding
PHP & MySQL - Certification Course for Beginners
Learn to Build Database Driven Web Applications using PHP & MySQL
Price : βΉ12,800 FREE
Use Coupon : YOUACCEL34521
Course Link - https://www.udemy.com/course/php-mysql-certification-course-for-beginners/
Coupon is working at the time of posting
#Update8
Join:- @programming_and_coding
Learn to Build Database Driven Web Applications using PHP & MySQL
Price : βΉ12,800 FREE
Use Coupon : YOUACCEL34521
Course Link - https://www.udemy.com/course/php-mysql-certification-course-for-beginners/
Coupon is working at the time of posting
#Update8
Join:- @programming_and_coding
Udemy
PHP & MySQL - Certification Course for Beginners
Learn to Build Database Driven Web Applications using PHP & MySQL
106. Program to reverse the string.
#include<stdio.h>
#include<conio.h>
#include<string.h>
char *strrev(char *str)
{
char *p1, *p2;
if (!str || !*str)
return str;
for (p1 = str, p2 = str + strlen(str) - 1; p2 > p1; ++p1, --p2)
{
*p1 ^= *p2;
*p2 ^= *p1;
*p1 ^= *p2;
}
return str;
}
void main()
{
char arr[100];
clrscr();
printf("\nEnter a string to reverse : ");
gets(arr);
strrev(arr);
printf("\nReverse of entered string is : %s", arr);
getch();
}
Join @programming_and_coding
#include<stdio.h>
#include<conio.h>
#include<string.h>
char *strrev(char *str)
{
char *p1, *p2;
if (!str || !*str)
return str;
for (p1 = str, p2 = str + strlen(str) - 1; p2 > p1; ++p1, --p2)
{
*p1 ^= *p2;
*p2 ^= *p1;
*p1 ^= *p2;
}
return str;
}
void main()
{
char arr[100];
clrscr();
printf("\nEnter a string to reverse : ");
gets(arr);
strrev(arr);
printf("\nReverse of entered string is : %s", arr);
getch();
}
Join @programming_and_coding
Deolite Off campus Job For Freshers.
Apply Link - https://jobs2.deloitte.com/ui/en/job/DELOA003XUSGLSINDIAE21HCBTASKOFFCAMPUSENUI/Off-Campus-Hiring-BTA
Join :- @programming_and_coding
Apply Link - https://jobs2.deloitte.com/ui/en/job/DELOA003XUSGLSINDIAE21HCBTASKOFFCAMPUSENUI/Off-Campus-Hiring-BTA
Join :- @programming_and_coding
Deloitte
Find Jobs - US External Careers
Find Jobs US External Careers
107. Program to reverse the string using pointer.
#include<stdio.h>
#include<conio.h>
void main()
{
char str_array[10000], *ptr;
int i, len;
clrscr();
printf("Enter a string : ");
gets(str_array);
ptr = str_array;
for (i = 0; i < 10000; i++)
{
if (*ptr == '\0')
break;
ptr++;
}
len = i;
ptr--;
printf("\nReversed String is : ");
for (i = len; i > 0; i--)
{
printf("%c", *ptr--);
}
getch();
}
@programming_and_coding
#include<stdio.h>
#include<conio.h>
void main()
{
char str_array[10000], *ptr;
int i, len;
clrscr();
printf("Enter a string : ");
gets(str_array);
ptr = str_array;
for (i = 0; i < 10000; i++)
{
if (*ptr == '\0')
break;
ptr++;
}
len = i;
ptr--;
printf("\nReversed String is : ");
for (i = len; i > 0; i--)
{
printf("%c", *ptr--);
}
getch();
}
@programming_and_coding
108. Program to sort the strings.
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int i, j, n;
char str[20][20], temp[20];
clrscr();
printf("Enter the number of string to be sorted : ");
scanf("%d", &n);
for (i = 0; i <= n; i++)
gets(str[i]);
for (i = 0; i <= n; i++)
for (j = i + 1; j <= n; j++)
{
if (strcmp(str[i], str[j]) > 0)
{
strcpy(temp, str[i]);
strcpy(str[i], str[j]);
strcpy(str[j], temp);
}
}
printf("\nSorted string :");
for (i = 0; i <= n; i++)
{
puts(str[i]);
}
getch();
}
@programming_and_coding
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int i, j, n;
char str[20][20], temp[20];
clrscr();
printf("Enter the number of string to be sorted : ");
scanf("%d", &n);
for (i = 0; i <= n; i++)
gets(str[i]);
for (i = 0; i <= n; i++)
for (j = i + 1; j <= n; j++)
{
if (strcmp(str[i], str[j]) > 0)
{
strcpy(temp, str[i]);
strcpy(str[i], str[j]);
strcpy(str[j], temp);
}
}
printf("\nSorted string :");
for (i = 0; i <= n; i++)
{
puts(str[i]);
}
getch();
}
@programming_and_coding
π°Adobe MEGA MOD Packπ°
π₯Contents of the MEGA Pack-
πAdobe Premiere Pro CC 2018
πAdobe Prelude CC 2018
πAdobe Lightroom CC 2018
πAdobe Lightroom Classic CC 2018
πAdobe Photoshop CC 2018
πAdobe Muse CC 2018
πAdobe Media Encoder CC 2018
πAdobe InDesign CC 2018
πAdobe InCopy CC 2018
πAdobe Illustrator CC 2018
πAdobe Dreamviewer CC 2018
πAdobe Dimensions CC 2018
πAdobe Character Animator CC 2018
πAdobe Bridge CC 2018
πAdobe Audition CC 2018
πAdobe Animate CC 2018
πAdobe After Effects CC 2018
ββββββββββββ
π₯ Download Link :- https://drive.google.com/drive/u/0/folders/1yDGZ4lOhPiEkG7bG8M8qs5X-E7_I-85d
ββββββββββββ
Only on @programming_and_coding
πNote: The Above Softwares are Provided in Google Drive! So, Download Them ASAP!
π₯Contents of the MEGA Pack-
πAdobe Premiere Pro CC 2018
πAdobe Prelude CC 2018
πAdobe Lightroom CC 2018
πAdobe Lightroom Classic CC 2018
πAdobe Photoshop CC 2018
πAdobe Muse CC 2018
πAdobe Media Encoder CC 2018
πAdobe InDesign CC 2018
πAdobe InCopy CC 2018
πAdobe Illustrator CC 2018
πAdobe Dreamviewer CC 2018
πAdobe Dimensions CC 2018
πAdobe Character Animator CC 2018
πAdobe Bridge CC 2018
πAdobe Audition CC 2018
πAdobe Animate CC 2018
πAdobe After Effects CC 2018
ββββββββββββ
π₯ Download Link :- https://drive.google.com/drive/u/0/folders/1yDGZ4lOhPiEkG7bG8M8qs5X-E7_I-85d
ββββββββββββ
Only on @programming_and_coding
πNote: The Above Softwares are Provided in Google Drive! So, Download Them ASAP!
109. Program to swap two strings.
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
void main()
{
char str1[100], str2[100], *temp;
clrscr();
printf("Enter first string : ");
gets(str1);
printf("Enter second string : ");
gets(str2);
printf("\nBefore Swapping : \n");
printf("First string : %s\n", str1);
printf("Second string : %s\n", str2);
temp = (char *) malloc(100);
strcpy(temp, str1);
strcpy(str1, str2);
strcpy(str2, temp);
printf("\nAfter Swapping : \n");
printf("First string : %s\n", str1);
printf("Second string : %s\n", str2);
getch();
}
@programming_and_coding
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
void main()
{
char str1[100], str2[100], *temp;
clrscr();
printf("Enter first string : ");
gets(str1);
printf("Enter second string : ");
gets(str2);
printf("\nBefore Swapping : \n");
printf("First string : %s\n", str1);
printf("Second string : %s\n", str2);
temp = (char *) malloc(100);
strcpy(temp, str1);
strcpy(str1, str2);
strcpy(str2, temp);
printf("\nAfter Swapping : \n");
printf("First string : %s\n", str1);
printf("Second string : %s\n", str2);
getch();
}
@programming_and_coding
110. Program to add two matrix.
#include<stdio.h>
#include<conio.h>
void main()
{
int m, n, c, d, first[10][10], second[10][10], sum[10][10];
clrscr();
printf("Enter the number of rows and columns of matrix :");
scanf("%d%d", &m, &n);
printf("\nEnter the elements of first matrix : \n");
for (c = 0; c < m; c++)
{
for (d = 0; d < n; d++)
{
scanf("%d", &first[c][d]);
}
}
printf("\nEnter the elements of second matrix : \n");
for (c = 0; c < m; c++)
{
for (d = 0; d < n; d++)
{
scanf("%d", &second[c][d]);
}
}
printf("\nSum of entered matrices : \n");
for (c = 0; c < m; c++)
{
for (d = 0; d < n; d++)
{
sum[c][d] = first[c][d] + second[c][d];
printf("%d\t", sum[c][d]);
}
printf("\n");
}
getch();
}
@programming_and_coding
#include<stdio.h>
#include<conio.h>
void main()
{
int m, n, c, d, first[10][10], second[10][10], sum[10][10];
clrscr();
printf("Enter the number of rows and columns of matrix :");
scanf("%d%d", &m, &n);
printf("\nEnter the elements of first matrix : \n");
for (c = 0; c < m; c++)
{
for (d = 0; d < n; d++)
{
scanf("%d", &first[c][d]);
}
}
printf("\nEnter the elements of second matrix : \n");
for (c = 0; c < m; c++)
{
for (d = 0; d < n; d++)
{
scanf("%d", &second[c][d]);
}
}
printf("\nSum of entered matrices : \n");
for (c = 0; c < m; c++)
{
for (d = 0; d < n; d++)
{
sum[c][d] = first[c][d] + second[c][d];
printf("%d\t", sum[c][d]);
}
printf("\n");
}
getch();
}
@programming_and_coding