Category: Programming
code: #include<stdio.h> int main() { int i=1; while(i<=printf(“Hi\n”)){ printf(“Hello\n”); i++; } printf(“%d\n”,i); return 0; } output: Hi…
code: #include<stdio.h> int main() { int number,sum=0; printf(“Enter a positive number, negative to terminate:”); scanf(“%d”,&number); while(number>=0) {…
Conditional Question: source: http://101cproblems.com/problem-25/ Problem 25: Coordinate Take two integers indicating the x and y coordinate of…
One thing was confusion for me but after watching this tut it is clear to me now….
code: #include<stdio.h> int main() { int year,x; printf(“Enter year:”); scanf(“%d”,&year); //((year%4==0&&year%100!=0)||(year%400==0))?:printf(“%d is not leap year.”,year); x=((year%4==0&&year%100!=0)||(year%400==0))?1:0; if(x==0)…
code: #include<stdio.h> int main() { int a=20,b=50,c=40,m; // if(a>b && a>c) // m=a; // else if(b>c) //…
Recent Comments