C Programming String Practice
01. Array
#include<stdio.h> void printNumbers (int arr[], int n); int main(){ int arr[]={1,2,3,4,5,6,7,8}; printNumbers(arr,8); return 0; } void printNumbers(int arr[], int n){ for(int i=0; i<n; i++){ printf("%d\t", arr[i]); } printf("\n"); }
02. Array
#include<stdio.h> int main(){ float price[3]; printf("Enter 3 prices: "); scanf("%f", &price[0]); scanf("%f", &price[1]); scanf("%f", &price[2]); printf("Total price 1 : %f\n", price[0]+(0.18*price[0])); printf("Total price 2 : %f\n", price[1]+(0.18*price[1])); printf("Total price 3 : %f\n", price[2]+(0.18*price[2])); return 0; }
Thank You!
Leave a Reply