0% found this document useful (0 votes)
9 views

C Lab Format

questions based on c programing for beginners

Uploaded by

chinmay9286
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

C Lab Format

questions based on c programing for beginners

Uploaded by

chinmay9286
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Programming in C

Lab Assignment

Bachelor of Technology

Submitted by

Name:- Chinmay khare Roll No.590017049

Submitted to
Dr. Hemant Petwal

UPES
Bidholi, Via Prem Nagar, Dehradun, Uttarakhand
July-Dec – 2024
Lab Assignment 1

Question 1: Write a C program to print “Hello world”.

Solution:

Coding Output
#include<stdio.h>
int main()
{
printf("Hello World");
return 0; }

Question 2: Write a C program to print the address in multiple lines (new lines)

Solution:

Coding Output
#include<stdio.h>
int main()
{
printf("Ivy league
boys hostel\nNear upes
college\nDehradun
248001");
return 0; }
Question 3: Write a program that prompt the user to enter their name and age.

Solution:

Coding Output
#include<stdio.h>
int main()
{
int age,name;

printf("Enter age: ");


scanf("%d",&age);
printf("Enter name: ");
scanf("%d",&name);
return 0;
}

Question 4: Write a C program to add two numbers, Take numbers from user.

Solution:

Coding Output
#include<stdio.h>
int main()
{
int a,b,c,y;

printf("Enter a: ");
scanf("%d",&a);
printf("Enter b: ");
scanf("%d",&b);
printf("Enter c: ");
scanf("%d",&c);
y=a+b+c;

printf("%d",y);
}

Array is a collection of homogenous data type or sequential data type


String: Collection of characters
If a variable is holding an address it is known as pointer

You might also like