Count how many integers from 1 to N contains 0's as a digit? Please share the sample c program?
#include< stdio.h> int main() { int n,rim,count=0,i,temp; scanf("%d",&n); for(i=1;i<=n;i++) { temp=i; while(temp) { rim=temp%10; if(rim==0) { count++; break; } temp=temp/10; } } printf("%d",count); }
You are given 2 long integers having n digits each and you are required to multiply them using C.
Assumptions Numbers are represented in an array of size n . Calculate the time complexity using traditional divide and conquer
Given an unordered array A of size n and integer x. What is the best complexity to find two elements in A whose sum is x? Share the algo, its complexity and if possible C code.