What do you want to save?
Add Code snippet
New code examples
-
C 2022-02-06 11:45:14
c program to find the sum of given number
# include<stdio.h> int main { int number; int sum=0; int remainder; printf("enter a number\n"); scanf("%d",&number); for(;number!=0;) { remainder=number%10; sum=sum+remainder; number=number/10; } printf("sum of digits=%d... Add solution -
C++ 2022-02-05 10:40:25
Write a program that asks a user for their birth year encoded as two digits (like "62") and for the current year, also encoded as two digits (like "99"). The program is to correctly write out the users age in years
#include<stdio.h> int main(){ signed int current, birth, a; printf("Enter Year of Birth\n"); scanf("%d",&birth); printf("Enter Current year\n"); scanf("%d",¤t); if(current<birth) ... Add solution -
C 2022-02-02 23:50:43
a program to find the numbers of positive, negative, odd and even numbers in a set of numbers in C
#include <stdio.h> void main () { int a[100]; int num,i; printf("How many numbers do you want to enter? : "); scanf("%d",&num); fflush(stdin); for (i=0;i<num;i++) { printf("Enter %d... Add solution -
Other 2022-02-02 19:20:46
c language quadratic equation
#include <stdio.h> #include <math.h> int main() { int a, b, c, d; double root1, root2; printf("Enter a, b and c where a*x*x + b*x + c = 0\n"); scanf("%d%d%d", &a, &b, &c); d = b*b - 4*a*c; if (d &... Add solution -
TypeScript 2022-01-31 20:22:02
write a progam to take the hour munite and second components of two times of a day and find out their difference (assume the latest time is given first)
#include <stdio.h> struct TIME { int seconds; int minutes; int hours; }; void differenceBetweenTimePeriod(struct TIME t1, struct TIME t2, struct TIME *diff); int main() { ... Add solution