V

@vanshu_179

program to enter price of 3 items & print their final cost with gst

C
3 years ago
#include <stdio.h> int main() { float price [3]; printf("enter three prices :\n"); scanf("%f", &price[0]); scanf("%f", &price[1]); scanf("%f", &price[2]);

array to print marks of 3 subjects

C
3 years ago
#include <stdio.h> int main() { int marks [3],maths,physics,chemistry; printf("enter maths marks : \n "); scanf("%d", &marks[0]); printf("enter physics marks : \n"); scanf("%d", &marks[1]);

calculate the sum,product & avg of 2 nos. print that sum , product & avg in the main function

C
3 years ago
#include <stdio.h> void dowork(int a,int b,int *sum, int *prod , int *avg); int main() { int a =3, b =5; int sum ,prod ,avg; dowork(a ,b ,&sum ,&prod ,&avg); printf("sum = %d, prod = %d, avg = %d\n",sum ,prod ,avg);

call by reference

C
3 years ago
#include<stdio.h> void swap (int *a, int *b); int main() { int x=3,y=5; swap(&x ,&y); printf("x = %d & y = %d \n", x , y); return 0; }

string manipulation function

C
3 years ago
#include <stdio.h> #include<string.h> int main() { char password[]= 'a'; char input[15]; int match; printf("password :%c"); scanf("%c",&input);

addition of two matrices

C
3 years ago
#include <stdio.h> int main() { int m, n, c, d, first[10][10], second[10][10], addition[10][10]; printf("Enter the number of rows and columns of matrix\n"); scanf("%d%d", & m, & n); printf("Enter the elements of first matrix\n"); for (c = 0; c < m; c++) for (d = 0; d < n; d++) scanf("%d", &first[c][d]);

subtraction of two matrices

C
3 years ago
#include <stdio.h> int main() { int m, n, c, d, first[10][10], second[10][10], difference[10][10]; printf("Enter the number of rows and columns of matrix\n"); scanf("%d%d", & m, & n); printf("Enter the elements of first matrix\n"); for (c = 0; c < m; c++) for (d = 0; d < n; d++) scanf("%d", &first[c][d]);

1 d array for addition and subtraction

C
3 years ago
#include <stdio.h> int main() { int i,j,array[10]={ 17,23,34,54,12,56,31,56,56,12}; printf("enter two numbers \n"); scanf("%d %d",&i ,&j); int sum = array[i] + array [j]; int difference = array[i] - array[j];

1 d array for addition

C
3 years ago
#include <stdio.h> int main() { int i,j,array[10]={ 17,23,34,54,12,56,31,56,56,12}; printf("enter two numbers \n"); scanf("%d %d",&i ,&j); int sum = array[i] + array [j]; printf("the sum of two elements is :%d \n",sum);

1 d array

C
3 years ago
#include <stdio.h> int main() { int i,array[10]={ 17,23,34,54,12,56,31,56,56,12}; int sum = array[3] + array[0]; int difference = array [3] - array[2]; printf("sum of the 1st and 4th element of the array: %d\n", sum); printf("difference between 4th and 3rd element of the array:%d\n", difference);

no. is palindrome or not

C
3 years ago
#include <stdio.h> int main() { int reverse =0; int number; int original; printf("enter a number\n"); scanf("%d",&number);

find the roots of quadratic equation

C
3 years ago
#include <stdio.h> #include<math.h> void main(){ float a,b,c,d,r2,r1,r; printf("enter coefficients \n"); scanf("%f%f%f",&a,&b,&c); d= (b*b)- (4 *a *c); printf("the value of d is %f \n",d);

passing values in array

C
3 years ago
#include <stdio.h> void display(int,age) { printf("%d",age); } int main() { int age array[]= {2,3,4}; display(age array [2]); return 0;

call by value

C
3 years ago
#include <stdio.h> //#include <conio.h> int swap(int x,int y); int main() { int a=100,b=200; //clrscr(); swap(a,b); printf("value of a %d \n",a);

fibonacci series without recursion

C
3 years ago
#include <stdio.h> int main(){ int n1=0,n2=1,i,n; printf("enter the value of n \n"); scanf("%d",&n); printf("%d",n1); for(i=1;i<=(n-1);i++) {

pointer base

C
3 years ago
#include <stdio.h> int main() { int age =22; int *ptr=&age; int _age=*ptr; printf("%d",_age); return 0; }

write a function to print n terms of the fibonacci sequence

C
3 years ago
#include <stdio.h> int fib(int n); int main() { printf("fibonacci is %d",fib(9)); return 0; }

write a program to calculate %age of a student from marks in sci,maths & skt

C
3 years ago
#include <stdio.h> #include<math.h> int calcpercentage(int science, int maths, int sanskrit); int main() { int science = 88; int maths = 84; int sanskrit = 99;

write a program to print the prime no in a range

C
3 years ago
#include <stdio.h> #include<math.h> int main() { int a,b,i,j, flag; printf("enter lower bond of interval \n"); scanf("%d",&a); //TAKE INPUT printf("enter upper bond of interval \n"); scanf("%d",&b); printf("prime no between %d and %d are: \n",a,b);

function to convert celcius to fahrenheit

C
3 years ago
#include <stdio.h> float converttemp(float celcius); int main() { float far= converttemp(37); printf("far :%f",far); return 0; }