Pages

Monday, February 8, 2016

C program to read roll number and marks from user and display it on screen.

This program shows how to declare and use int variables. Read roll number and marks from user and display it on screen.

#include<stdio.h>
int main()
{
int marks,rollno;

printf("Enter your Roll No:");
scanf("%d", &rollno);

printf("Enter your Marks:");
scanf("%d", &marks);

printf("Your Roll No: %d.\n", rollno);
printf("Your marks: %d", marks);
return 0;
}

Output of program

Enter your Roll No:101
Enter your Marks:70
Your Roll No: 101.
Your marks: 70


1 comment: