J

@jayanth_balamurugan_R

Program to print Matrix and calculate Sum

C
2 years ago
#include <stdio.h> int main() { int a[2][3],i,j,sum=0; for (i=0;i<2;i++){ for (j=0;j<3;j++){ scanf("%d",&a[i][j]); } } for (i=0;i<2;i++){

sum of 2 arrays in third array

C
2 years ago
#include <stdio.h> int main() { int arr1[5],arr2[5], arr3[5]; int i; for (i=0;i<5;i++){ scanf("%d",&arr1[i]); } for (i=0;i<5;i++){ scanf("%d",&arr2[i]);

the number of odd and even elements in an array.

C
2 years ago
#include <stdio.h> int main() { int arr[10], i; int even,odd; for (i=0;i<10;i++){ scanf("%d",&arr[i]); } for (i=0;i<10;i++){ if (arr[i]%2==0){

sum and average

C
2 years ago
#include <stdio.h> int main() { int arr[5], i; int sum=0; float avg; for (i=0;i<5;i++){ scanf("%d",&arr[i]); } for (i=0;i<5;i++){

1D array

C
2 years ago
#include <stdio.h> int main() { int arr[5]; int i; for (i=0;i<5;i++){ scanf("%d",&arr[i]); } for (i=0;i<5;i++){ printf("%d ",arr[i]);

decode

C
2 years ago
#include<stdio.h> #include<string.h> int main() { char s[50]="G12o45o657D896J2508657B"; char m[100]; int i,j=0; for(i=0;s[i]!='\0';i++)

palindrome.

C
2 years ago
#include <stdio.h> #include <string.h> int main() { char str[90]; int i=0, l=0, c=0; printf("enter a string: "); scanf("%s",str); l=strlen(str); for (i=0;i<l/2;i++){ if (str[i]==str[l-i-1]){

palindrome

C
2 years ago
#include <stdio.h> #include <string.h> int main() { char str[90]; int i=0, l=0, c=0; printf("enter a string: "); scanf("%s",str); l=strlen(str); for (i=0;i<l/2;i++){ if (str[i]==str[l-i-1]){

palindrome

C
2 years ago
#include <stdio.h> #include <string.h> int main() { char str[90]=" "; int i=0, l=0, count=0; printf("enter a string: "); scanf("%s",str); l=strlen(str); for (i=0;i<l/2;i++){

vowels and consonants

C
2 years ago
#include <stdio.h> #include <string.h> int main() { char name[90]=" "; int i=0, vowels=0, consonants=0; scanf("%s",name); while (name[i]!='\0'){ if (name[i]=='a'|| name[i]=='e'||name[i]=='i'||name[i]=='o'||name[i]=='u'){ vowels++;

vowels

C
2 years ago
#include <stdio.h> #include<string.h> int main() { char name[50]; int i; char ch; int vowel=0,consonants=0;

string length

C
2 years ago
#include <stdio.h> #include<string.h> int main() { int count=0,i=0; char name[90]; printf("Enter name :\n"); scanf("%s",name);

string copy

C
2 years ago
#include <stdio.h> #include <string.h> int main() { char a[50]="vikkash"; char b[50]="mani"; strcpy(a,b); printf("%s",a); return 0; }

Write a program in C to print individual characters of a string in reverse order.

C
2 years ago
#include <stdio.h> #include <string.h> int main() { char str[50]=" "; int l,i ; fgets (str, sizeof str,stdin); l=strlen(str); for (i=l; i>=0; i--){ printf ("%c ",str[i]);

Write a program in C to separate individual characters from a string.

C
2 years ago
#include <stdio.h> #include <string.h> int main() { char str[90]=" "; int l=0; scanf("%s",str); while (str[l]!='\0'){ printf("%c ",str[l]); l++;

Write a program in C to input a string and print it.

C
2 years ago
#include <stdio.h> #include <string.h> int main() { char a[14]=" "; scanf("%s",a); printf("%s",a); return 0; }

string

C
2 years ago
#include <stdio.h> #include <string.h> int main(){ char a[]="I love C"; printf("%s",a); return 0; }

Write a program in C to input a string and print it

C
2 years ago
#include <stdio.h> #include <string.h> int main() { char a[]="string"; printf("%s",a); return 0; }

Write a C program to display the n terms of odd natural numbers and their sum.

C
2 years ago
#include <stdio.h> int main() { int i,sum=0; for (i=1;i<11;i=i+2){ printf("%d\n",i); sum=sum+i; } printf("sum=%d",sum); return 0;

Write a program in C to display the multiplication table for a given integer.

C
2 years ago
#include <stdio.h> int main() { int i, a, product; scanf("%d",&a); printf("the multiplication table of %d",a); for (i=0; i<13;i++){ product=a*i; printf("\n%d*%d=%d",a,i,product); }