Please scroll down for latest Programs 👇
Code compiled and tested successfully!
Problem Solving through Programming in C
NPTEL
Due date on 2026-08-13, 23:59 IST
Q.
[Marks for Week 3 Programming assignments will not be evaluated finally. This is for users to get familiar with programming in google course builder platform]
Complete Program
#include <stdio.h>
#define PI 3.14
void main()
{
int radius;
float area;
scanf("%d", &radius);
area = PI * radius * radius;
printf("Area of a circle = %5.2f", area);
}
Code Snippet to Paste in the Editor
To complete the middle portion between scanf("%d", &radius); and printf(...)
area = PI * radius * radius;
// copy until this point
Due date on 2026-08-13, 23:59 IST
Complete Program
#include <stdio.h>
int main()
{
double number;
scanf("%lf", &number);
if (number == 0) {
printf("The number is 0.");
} else if (number < 0) {
printf("Negative number.");
} else {
printf("Positive number.");
}
return 0;
}
Code Snippet to Paste in the Editor
If the template already includes the header and initial lines, add the following code after scanf("%lf", &number);:
if (number == 0) {
printf("The number is 0.");
} else if (number < 0) {
printf("Negative number.");
} else {
printf("Positive number.");
}
return 0;
}
// copy until this point
You may submit any number of times before the due date. The final submission will be considered for grading.This assignment has Public Test cases. Please click on "Compile & Run" button to see the status of Public test cases. Assignment will be evaluated only after submitting using Submit button below. If you only save as or compile and run the Program, your assignment will not be graded and you will not see your score after the deadline.
This assignment has Public Test cases. Please click on "Compile & Run" button to see the status of Public test cases. Assignment will be evaluated only after submitting using Submit button below. If you only save as or compile and run the Program, your assignment will not be graded and you will not see your score after the deadline.
Evaluation Results
CompilationSuccessful|Public Test Cases: 3/3 PassedNote: These tests may not be considered while scoring.
Note: These tests may not be considered while scoring.
Public Test Cases
Week-03: Practice Program-03Due date on 2026-08-13, 23:59 IST
Due date on 2026-08-13, 23:59 IST
Complete Program
C#include <stdio.h>
int main()
{
int number;
scanf("%d", &number);
if (number % 2 == 0) {
printf("%d is even.", number);
} else {
printf("%d is odd.", number);
}
return 0;
}
#include <stdio.h>
int main()
{
int number;
scanf("%d", &number);
if (number % 2 == 0) {
printf("%d is even.", number);
} else {
printf("%d is odd.", number);
}
return 0;
}
Code Snippet to Paste in the Editor
If entering only the remaining portion of code below scanf("%d", &number);
If entering only the remaining portion of code below scanf("%d", &number);
if (number % 2 == 0) {
printf("%d is even.", number);
} else {
printf("%d is odd.", number);
}
return 0;
}
// copy until this point
This assignment has Public Test cases. Please click on "Compile & Run" button to see the status of Public test cases. Assignment will be evaluated only after submitting using Submit button below. If you only save as or compile and run the Program, your assignment will not be graded and you will not see your score after the deadline.
Evaluation Results
Note: These tests may not be considered while scoring.
Due date on 2026-08-13, 23:59 IST
Complete Program
#include <stdio.h>
int main()
{
int n1, n2, n3;
scanf("%d %d %d", &n1, &n2, &n3);
if (n1 >= n2 && n1 >= n3) {
printf("%d is the largest number.", n1);
} else if (n2 >= n1 && n2 >= n3) {
printf("%d is the largest number.", n2);
} else {
printf("%d is the largest number.", n3);
}
return 0;
}
Code Snippet to Paste in the Editor
If entering only the remaining portion of code below scanf("%d %d %d", &n1, &n2, &n3);
if (n1 >= n2 && n1 >= n3) {
printf("%d is the largest number.", n1);
} else if (n2 >= n1 && n2 >= n3) {
printf("%d is the largest number.", n2);
} else {
printf("%d is the largest number.", n3);
}
return 0;
}
// copy until this point
This assignment has Public Test cases. Please click on "Compile & Run" button to see the status of Public test cases. Assignment will be evaluated only after submitting using Submit button below. If you only save as or compile and run the Program, your assignment will not be graded and you will not see your score after the deadline.
Evaluation Results
Note: These tests may not be considered while scoring.