Make coding your habit. Learn coding with us and make it your passion. Many programs, different languages, ask questions, have your answer and learn easily how to code in each language.
Find Days and Months
Get link
Facebook
X
Pinterest
Email
Other Apps
-
C program to find the number of days and months on the basis of given input
In this post, I shared a C program to find the total number of months and the remaining days on the basis of the given input from the user.
#include <stdio.h>
#include <conio.h>
void main()
{
int day,month,day1;
printf("enter the number of days:\n");
scanf("%d",&day);
month=day/30;
day1=day%30;
printf(“month is =%d”,month);
printf(:days are =%d,day1);
getch();
}
Problem Statement: In a Water Jug Problem you are given two jugs, one 4-gallon and one 3-gallon, a pump which has unlimited water which you can use to fill the jug, and the ground on which water may be poured. Neither jug has any measuring markings on it. How can you get exactly 2 gallons of water in the 4-gallon jug? This problem can be solve using multiple techniques of Artificial Intelligence (AI). Here we are going to solve the Water Jug Problem using the Depth First Search (DFS) Algorithm. To solve the problem with Breath First Search (BFS), check it here. Here is the code for the current problem statement. Firstly, let include all the header files. Now we have to define a structure for the nodes which we are going to use it for the further process. Below code snippet of code is for the same. #include<stdio.h> #include<conio.h> struct node { int x, y; struct node *next; }*root, *left, *right; Now we have to check weather the node whi...
Hello friends, in this tutorial we will learn how to upload an image from android to php server. Lets go for it. Prerequisites: Android Studio Xampp or Wamp Server (I am using Xampp here) Text Editor (I recommend to use Sublime) Structure of the Database: Firstly, we use our Android Studio to make our front part ready to capture the photo and get it ready to upload on the server. To get start with the actual code add the permissions and dependencies to make the project work properly. Add below permissions in the Manifests file. <uses-permission android:name="android.permission.INTERNET"></uses-permission> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"></uses-permission> And add the volley dependency in the build.gradle file of the App Module. implementation 'com.android.volley:volley:1.1.1' So, initially we make our layout for the Main Activity. Here is the layout co...
C program for "Call By Value" The call by value method of passing arguments to a function copies the actual value of an argument into the formal parameter of the function. In this case, changes made to the parameter inside the function have no effect on the argument.
Comments
Post a Comment