A

@amruthag

add two numbers using user-defind function

C
3 years ago
#include <stdio.h> int add(int num1,int num2); int main() { int n1,n2,result; printf("enter any 2 numbers\n"); scanf("%d%d",&n1,&n2); result=add(n1,n2); printf("sum of two numbers is %d\n",result); return 0; }

reverse to string using inbiult function

C
3 years ago
#include <stdio.h> #include <string.h> int main() { char str1[20],str2[20]; int i,n; printf("Enter any string\n"); scanf("%s",str1); strcpy(str2,str1); strrev(str2);

consatinate of string

C
3 years ago
#include <stdio.h> int main() { printf("Hello world!\n"); return 0; }

intilization of string

C
3 years ago
#include<stdio.h> #include<string.h> int main() { char str1[20],str2[20]; printf("enter string1\n"); scanf("%s",str1); printf("enter string2\n"); scanf("%s",str2); printf("the string is %s %s\n",str1,str2);

comper without using string

C
3 years ago
#include <stdio.h> #include<string.h> int main() { char str1[20],str2[20]; int i; printf("enter the string1:\n"); scanf("%s",str1); printf("enter the string2:\n"); scanf("%s",str2); while(str1[i]!='\0'&& str1[i]==str2[i])

fiind length string without in built function

C
3 years ago
#include <stdio.h> #include <string.h> int main() { char str[20]; int i=0; printf("enter any string\n"); scanf("%s",str); while(str[1]!='\0') { i++;

demostrate streat

C
3 years ago
#include <stdio.h> #include <string.h> int main() { char string1[20],string2[10]; char string3[10]; int result; printf("enter string1\n"); scanf("%s",string1); printf("enter string2\n"); scanf("%s",string2);

string manipulation functions in built functions

C
3 years ago
#include <stdio.h> int main() { printf("Hello world!\n"); return 0; }

sum of two numbers

C
3 years ago
#include <stdio.h> int main() { int a[5][5],i,j,m,n,b[5][5],res[5][5]; printf("enter the order of matrix m,n\n"); scanf("%d%d",&m,&n); printf("enter the elements of array A\n"); for(i=1;i<=m;i++) { for(j=1;j<=n;j++)

sum of elements

C
3 years ago
#include <stdio.h> #define rows 10 #define cols 10 int main() { int a[rows][cols],i,j,m,n,sum; printf("enter the order of matrix(m,n)\n"); scanf("%d%d",&m,&n); printf("enter the elements of array\n"); for(i=1;i<=m;i++) {

two dimensional

C
3 years ago
#include <stdio.h> #define rows 10 #define cols 10 int main() { int a[rows][cols],i,j,m,n; printf("enter the order of matrix(m,n)\n"); scanf("%d%d",&m,&n); printf("enter the elements of array\n"); for(i=0;i<m;i++) {

two dimesional array in matrix form

C
3 years ago
#include <stdio.h> #define rows 10 #define cols 10 int main() { int a[rows][cols],i,j,m,n; printf("enter the order of matrix(m,n)\n"); scanf("%d%d",&m,&n); printf("enter the elements of array\n"); for(i=0;i<m;i++) {

sec-largest position

C
3 years ago
#include <stdio.h> #include<limits.h> int main() { int arr[20]; int i,N, largest,sec_largest=INT-MIN,pos; printf("enter size of array:"); scanf("%d",&N); printf("enter %d elements in array:",\N); for(i=1;i<=n;i++) {

second smallest

C
3 years ago
#include <stdio.h> #include<limits.h> int main() { int arr[20]; int i,N,small,sec_smallest=INT_MAX; printf("enter size of array:"); scanf("%d",&N); printf("enter %d elements in array:",N); for(i=1;i<=N;i++)

second smallest

C
3 years ago
#include <stdio.h> #include<limits.h> int main() { int arr[20]; int i,N,small,sec_smallest=INT_MAX; printf("enter size of array:"); scanf("%d",&N); printf("enter %d elements in array:",N); for(i=1;i<=N;i++)

largest

C
3 years ago
#include <stdio.h> int main() { int arr[20]; int i,N,large,small; printf("enter size of an array\n"); scanf("%d\n",&N); printf("enter %d elements in array:",N); for(i=1;i<=N;i++) {

smallest numbers using array

C
3 years ago
#include <stdio.h> int main() { int arr[30]; int i,n; printf("enter any size of array\n"); scanf("%d",&n); printf("enter any size of array:\n"); for(i=n;i>=n;i--) {

even numbers using array

C
3 years ago
#include <stdio.h> int main() { int arr[20]; int i,N; printf("enter size of array\n"); scanf("%d\n",&N); printf("enter %d elements in array:",N); for(i=1;i<=N;i++) {

array program

C
3 years ago
#include <stdio.h> int main() { int arr[30]; int i,n; printf("enter any size of array\n"); scanf("%d",&n); printf("enter any size of array:\n"); for(i=n;i>=n;i--) {

revers

C
3 years ago
#include <stdio.h> int main() { int arr[20]; int i,n; /*input array size*/ printf("enter any size of array\n"); scanf("%d",&n); /*input elements in array*/ printf("enter %d elements in array:\n",n);